git master branch에 작업한 것 push 하는 법

rowan·2023년 2월 28일
0

개발자

목록 보기
10/13

보통 개발자마다 개별 branch를 두고 git에 push 하는 것이 일반적이지만 간혹 master branch 하나로만 git 관리를 하는 곳도 있다. 그럴 때 참고하면 좋을 것 같아서 글을 쓰게 되었다.




이렇게 하세요:

git add .
git commit -m "comment"
git pull origin master
git push origin master



push나 pull이 제대로 안될 때:

Fatal: Not possible to fast-forward, aborting
Fatal: 정방향이 불가능하므로, 중지합니다.
👉 이런 에러가 뜨면서 pushpull이 안됨

  • push
git push origin master --force

  • pull
git pull --rebase



fast-forward only 옵션 끄기:

git config pull.ff only

또는

git config --unset pull.ff
git config --unset --global pull.ff



git branch graph 보는 법:

git log --graph
profile
hi im rowan

0개의 댓글