티스토리 뷰

기타개발

github - push, pull 오류 해결법

쉬엄쉬엄하자 2021. 6. 20. 23:15
728x90

 

0. 오류 내용

깃 허브 푸시 명령을 치면 이런 오류가 뜨는 경우가 있다. 이경우에는 원격저장소의 상태와 로컬저장소의 상태를 맞춰주기 위해 pull을 진행후에 push를 하여 해결 할 수 있다.

error: failed to push some refs to 

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을하려고하면 이런 오류가 뜰 수 있다.

 

 refusing to merge unrelated histories

 

git pull origin 브런치명 --allow-unrelated-histories

이럴떄는 위 명령어를 통해 pull을 하면된다

 

 

댓글