hello-world라는 프로젝트를 hello-people 계정의 repository에 업로드 하는 예시입니다.
- github repository를 hello-world라고 만들어줍니다.
- 프로젝트를 create-react-app을 사용해서 만들어줍니다.
npx create-react-app hello-world - 프로젝트 폴더 내로 이동해줍니다.
cd hello-world/ - .git 파일이 이미 존재하므로 git init을 하기 위해 지워줍니다. (rm은 언제나 조심해서 사용합시다)
rm -rf .git - git 환경을 만들어줍니다.
git init - 만들어준 hello-world repository를 remote로 등록해줍니다.
git remote add origin ~~~ - create-react-app으로 만들어진 파일들을 staging해줍니다.
git add . - staging된 파일들을 커밋해줍니다.
git commit -m "first commit" - 푸쉬해주면 끝입니다.
git push origin main
'Tools > Git' 카테고리의 다른 글
git add * vs git add . (0) | 2023.04.07 |
---|