Devops/Git
fatal: refusing to merge unrelated histories
2mukee
2021. 8. 2. 17:46
320x100
320x100
Git hub에서 push 할 때
fatal: refusing to merge unrelated histories 이라는 오류가 발생하면
git pull origin 브랜치 --allow-unrelated-histories
git add .
git commit -m '코멘트'
git push -u origin 브랜치
하면 정상적으로 push가 된다
다만
--allow-unrelated-histories 옵션으로 인해
history까지 저장되며 소스코드에 변경사항이 그대로 올라간다
때문에 새로운 수정사항이 있는 소스코드를 따로 백업하고
이 작업을 한 뒤에
소스코드 들의 수정시간을 다시 변경하여
다시 push하는 것을 권장한다
300x250
728x90