-
[Git] Fork를 사용해보자!공부/Git 2020. 9. 5. 03:18
지금까지 나의 레포가 아닌 팀장의 레포에서 푸쉬, 풀하는 방식으로 깃헙을 사용했습니다.
좀 더 큰 규모의 협업을 하게되니 깃헙의 필요성이 절실하게 느껴졌어요...!😣
기왕이면 자신의 레포에서 Fork, pull request를 하려고 했는데 삐그덕삐그덕
시행착오를 몇 주 겪고 얻은 사용법을 정리합니다.
1. Fork 해오기🍴
- 가장 먼저 original repository에서 Fork 합니다.
2. Fork한 repository 연결하기📡
git clone <Fork뜬 내 저장소>
-
git remote add upstream <Original repository>
확인은
git remote -v
git fetch upsteam
-
git chechout -b feature/seungah
확인은
git branch
3. 작업물 Commit 🎇
-
git add .
-
git status
-
git commit -m "message"
-
git checkout master
-
git fetch upstream
-
git rebase upstream/master
-
git checkout feature/seungah
-
git rebase master
-
git push origin feature/seungah
-
pull request
4. 작업하던 중 충돌없이 upstream의 최신 상태로 업데이트
- git fetch upstream
- git stash
- git merge upstream/master
- git stash apply
- git push orgin
'공부 > Git' 카테고리의 다른 글
[정말정말 궁금했던] ! [rejected] master -> master (fetch first) (0) 2020.08.11 Submodule, Nestued Repository (0) 2020.07.26