카테고리 없음
git pull 에러 # merge # rebase # fast-forward only
Deeb
2022. 10. 4. 16:00
힌트: 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 (the default strategy)
힌트: 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.
팀 github에서 git pull 을 했는데 위와같은 경고 문구가 떴다.
일단 먼저 체크해본 것 내가 해당 레포지토리의 권한이 있는가? -> yes. 이전에 push를 했던 적이 있기에 권한 문제는 아님
위의 에러를 보고 내가 해결한 방법은
git config pull.rebase false
다른 팀원들과 작업한 파일들 중 겹치는 파일은 없었기에 merge로 진행했고 그 뒤에 git pull origin <브랜치명>을 했지만
기존에 pull을 받지 않는동안 commit된 파일들까지 다 내 브랜치로 들어와서 거의 수십개의 파일들이 update되었다고 떴다.
애초에 근본적인 해결법
git fetch를 하고서 git pull을 진행했어야했다
참고자료
스택오버플로우
참고한 블로그
git pull 할 때 fatal: Need to specify how to reconcile divergent branches. 오류
현재 내 깃 버전은 다음과 같다. 어떤 버전에서부터인진 모르겠지만 이전 버전에서는 git pull을 할 때 자동으로 merge 전략을 사용한 것 같지만 최신 버전에서는 어떤 전략을 사용할지 따로 지정되
velog.io
반응형