[Git] git pull 안됨 & Not possible to fast-foward, aborting

🌊·2022년 7월 27일

문제발생

local branch가 remote branch 보다 커밋이 앞서 있어서 발생

아래와 같은 에러메세지가 출력이 된다.
에러메세지

git pull 안되는 문제 해결

에러메세지가 알려준 힌트를 따른다.

git config pull.rebase false
: pull 할때 rebase 하지 않고 merge 한다.
git config pull.rebase true
: pull 할때 rebase 한다.
git config pull.ff only
: fast-foward일때만 pull을 허용한다.

하지만, Fatal: Not possible to fast-forward, aborting / fatal: 정방향이 불가능하므로, 중지합니다. 이러한 에러가 떠버렸다.

Not possible to fast-foward, aborting 해결

1) git pull --rebase로 해결한다.
2) 근본적인 해결
git pull 문제 해결에서 세번째 명령(git config pull.ff only)은 fast-forward만 하겠다는 것이다.
이 경우 merge가 불가능하고, merge가 필요한 경우에는 정방향으로 진행하는게 불가능하다는 에러 메세지가 뜨면서 진행을 하지 않는다.
따라서 근본적으로 해결하려면 fast-forward only 옵션을 아래 명령을 이용해 끄면된다.

git config --unset pull.ff

참고 : https://sanghye.tistory.com/43

profile
기록

0개의 댓글