에러

[github push error] - error: failed to push some refs to 'https://github.com/'

코딩하는 둥아 2020. 7. 16. 16:23
728x90

* error: failed to push some refs to 'https://github.com/~~~'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

 

이 오류는 현재 로컬 저장소와 원격 저장소의 상태가 다를 때 발생하는 것.

그래서 pull을 해줘서 로컬과 원격 저장소의 상태를 동일하게 해준다.

이런 경우에는 pull을 해주고 push를 이어서 해주면 된다!

 

그런데 fatal: refusing to merge unrelated histories라는 오류가 뜨면서 push가 안되는 경우가 간혹 있다.

이런 경우에는 

git pull seunga master --allow-unrelated-histories

를 통해 pull을 해주자!

 

git push seunga master

이후에 push를 해주면 깔끔하게 푸쉬 완료!

728x90