[240128] Git pull 전략 (default, –ff -only, –rebase)

Git pull 전략 (default, –ff -only, –rebase)

—ff -only

  • git pull 은 기본적으로 git marge FETCH_HEAD 와 같이 동작한다.
  • 즉, 기본 모드의 경우 git merge commit 이 생성하게 된다.

—rebase

  • 새 브랜치가 시작된 분기점 commit 이 기준 브랜치의 가장 최근 commit으로 변경한다.

git pull 시 발생하는 warning 해결하기(Need to specify how to reconcile divergent branches)

힌트: You have divergent branches and need to specify how to reconcile them.
힌트: You can do so by running one of the following commands sometime before
힌트: your next pull:
힌트: 
힌트:   git config pull.rebase false  # merge
힌트:   git config pull.rebase true   # rebase
힌트:   git config pull.ff only       # fast-forward only
힌트: 
힌트: You can replace "git config" with "git config --global" to set a default
힌트: preference for all repositories. You can also pass --rebase, --no-rebase,
힌트: or --ff-only on the command line to override the configured default per
힌트: invocation.
  • fast-forword 관계가 아니여서 생긴 오류
  • git merge 나 git rebase 로 fast-forward 관계로 만들어줘야함

git first-forword 관계 참고

도식으로 보는 git-merge의 –ff, –no-ff, –squash의 차이점

Categories:

Updated:

Leave a comment