[Git] git game - fakeTeamwork, push

2024. 7. 10. 10:07Git

728x90
반응형
SMALL

git fakeTeamwork [branch name] [commit count]

 

remote의 [branch name]에 [commit count] 만큼 커밋 추가

=> local과 remote의 상태가 다름

=> 내가 아닌 다른 팀원이 romote에 커밋을 추가한 것으로 취급할 수 있음

 

 

git push

 

local 상태를 remote에 반영하여 remote를 업데이트

 

remote : a <- b <- c <- d

local : a <- b <- e

위와 같은 상황에서 git push는 불가능

- remote를 local과 똑같이 만들지, 새로운 코드인 e만 추가할지 또는 다른 방법으로 할지 결정 불가능

- push 하기 전에 romote의 최신 상태를 합치도록 강제함

=> rebase나 merge로 해결 가능

=> git pull --rebase = fetch + rebase

 

 

remote rejected : 다수가 작업하는 레포지토리의 main 브랜치는 보통 lock되어 있음

=> push 불가능 (commit은 가능), pull request 해야됨

 


 

git game 정답

 

git clone
git fakeTeamwork 2
git commit
git pull

 

 

git commit
git commit
git push

 

 

git clone
git fakeTeamwork
git commit
git fetch
git rebase o/main
git push

 

 

git branch feature
git reset c1
git push origin feature
git checkout feature
728x90
반응형
LIST