Leopards의 members에 Evie 추가
→ 커밋 메시지: Add Evie to Leopards
아래 명령어로 push
git push
-> 이미 git push -u origin main으로 대상 원격 브랜치가 지정되었기 때문에 가능
→ GitHub의 파일들과 커밋 내역 확인
GitHub에서 Leopards의 members에 Dongho 추가
→ 커밋 메시지: Add Dongho to Leopards
아래 명령어로 pull
git pull
Main과 원격 모두 commit 된 거 확인 !
로컬에서 Leopards의 manager를 Dooli로 수정
→ 커밋 메시지: Edit Leopards manager
GitHub에서 Leopards의 coach를 Lupi로 수정
→ 커밋 메시지: Edit Leopards coach
git push
→ 원격에 먼저 적용된 새 버전이 있으므로 적용 불가
pull 해서 원격의 버전을 받아온 다음 push 가능
→ 원격의 어긋난 시간선을 한군데로 모아준 후 push
소스트리에서 확인해보기
→ 일단 원격에 맞춰서 일단 원격 걸 붙여준 다음에 내가한 걸 잘라서 붙여준 뒤 push
pull 상의 rebase는 다름 (협업시 사용 OK)
git push 실행
로컬에서 Panthers에 Maruchi 추가
→ 커밋 메시지: Add Maruchi to Panthers
원격에서 Panthers에 Arachi 추가
→ 커밋 메시지: Add Arachi to Panthers
pull 하여 충돌상황 마주하기
→ --no-rebase
git pull --no-rebase
중복 선택
git add .
git commit
→ --rebase
git pull --rebase
상대방 껄 먼저 붙이고 내꺼를 붙임(Arachi) Accept Current Change
git add .
git rebase --continue
git pull --rebase
Maruchi Accept Incoming Change
git add .
git rebase --continue
일반적으로는 로컬의 내역이 원격보다 뒤쳐져있을 때는 Push를 할 수 없음
그런데 원격에 올라가 있는 내용이 잘못되어서 로컬에 있는 걸로 강제로 변환해줘야할 때
( 원격에 있는 로컬과 다른 Commit은 몽땅 사라짐 (협업중에는 합의 없이 실행X)
아래 명령어로 원격에 강제 적용
git push --force