내가 협업 하려는 github Page의 Fork 작업을 진행합니다.
Fork한 자신의 github Page에서 Clone을 진행합니다.
git clone <복사한 Forked Repository 주소> <생성 폴더명>
clone을 성공한 폴더명으로 이동합니다.
cd <생성 폴더명>
Local Repository 확인합니다.
git remote -v
원본 Remote Repository 등록합니다.
git remote add <생성 폴더명 또는 upstream> <원본 Remote Repository URL>-
upstream저장소가 가진 commit 내역 확인합니다.
git fetch -all
이전 log history 를 보고 싶다면 아래 명령어를 사용합니다.
git log -10
본격적인 수정 작업은 모두 Local Repository에서 진행합니다.
Branch에서 작업함으로써 여러 수정을 거쳐도 Upstream 파일에 영향을 끼치지 않습니다.
git branch <branch name>
Local Repository에서 수정이 완료되면 그 내역을 원본 upstream이 아닌 Forked Repository에 Commit & Push 합니다.
git push <repository name> <branch name>
수정 내역들을 반영하는 작업을 시작하기 전에 upstream에 다른 협업자들이 먼저 업데이트한 수정 내역이 있는지 확인해봅니다.
git fetch upstream
upstream commit내역이 local commit과 충돌한다면 해당 충돌 부분을 해결한 수 다시 Forked Remote Repository에 Commit & Push 합니다.
git pull
git push <repository name> <branch name>