Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

Mintaka's log

[Github] push시 non-fast-forward 에러 본문

etc...

[Github] push시 non-fast-forward 에러

_해랑 2022. 11. 23. 00:29

위와 같은 에러시 먼저 다음 부분을 먼저 확인해 볼 것.

 

1. 하단 탭의 Git Repositories에서 해당 프로젝트의 Remotes > origin 오른쪽 클릭 > Configure Fetch... 

2. Advanced를 클릭 > 이미 있었다면 삭제하기 > source ref에 아까 에러났던 branch 선택 > add spec 클릭 > finish

3. save and fetch 클릭. 

4. git repositories에서 해당 프로젝트의 local 안에서 오른쪽 클릭 > merge

5. 그리고 package explorer에서 해당 프로젝트 오른쪽 클릭 > team > remote > push... 클릭해서 해당 창이 나오면 source ref 설정해주고 add spec 클릭, finish. 

 


https://docs.github.com/ko/enterprise-cloud@latest/get-started/using-git/dealing-with-non-fast-forward-errors

 

non-fast-forward 오류 처리 - GitHub Enterprise Cloud Docs

다른 사용자가 사용자와 동일한 분기에 푸시한 경우 Git에서 변경 내용을 푸시할 수 없습니다. $ git push origin main > To https://github.com/USERNAME/REPOSITORY.git > ! [rejected] main -> main (non-fast-forward) > error: fail

docs.github.com

내 경우엔 다른 사용자와 공유하고 있는 레포지토리는 아니었지만, github 자체에서 코드를 변경한 일이 있었는데 그것 때문에 벌어진 일 같다.