[GIT] "Not possible to fast-forward" 오류 처리

ZEDY·2023년 12월 7일

[Github] 깃허브

목록 보기
2/2

깃 이슈 해결 : "Not possible to fast-forward" 오류 처리

###문제 : git pull origin feature 시, fatal: Not possible to fast-forward, aborting. 오류 발생

해결 방법:

1. git pull --rebase origin feature 명령어 사용

하지만 다음과 같은 오류 발생

error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.

2. 해결 방법 : commit 또는 stash

커밋 또는 stash 진행

  • 보통 git stash 사용 (다른 개발자의 작업이 포함된 상황일 수 있음)

3. 충돌 발생 시 해결 방법 :

  • git status 명령어로 충돌 확인 후 수정
  • 파일 수정을 위해 해당 폴더로 이동
    - cat {파일명}.java로 파일 확인
    - vim {파일명}.java로 충돌 해결
    - i 입력 후 수정 후에는 ESC -> :wq로 저장 및 종료

4. 충돌 해결 후:

git add {파일명}.java
git commit -m "메시지"
다시 git pull 수행

5. 이후, Already up to date. 확인 후 작업 계속 진행 가능

profile
IT기획/운영

0개의 댓글