Stay Hungry Stay Foolish

TIL

[Git Error] [rejected] master -> master (non-fast-forward) 해결

dev스카이 2023. 10. 29. 20:06

git push -u master master 에러

 ! [rejected]        master -> master (non-fast-forward)
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.

 

해결 방법

git push master +master

 

발생원인

 .gitignore 파일 또는 README.md 파일로 인해 발생한다고 한다.


[참고링크] 👉 https://somjang.tistory.com/entry/Git-rejected-master-master-non-fast-forward-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95

 

[Git] ! [rejected] master -> master (non-fast-forward) 해결 방법

ubuntu@server:~/PythonHome/TestTA/api$ git push --set-upstream origin master Username for 'https://github.com': SOMJANG-42MARU Password for 'https://SOMJANG-42MARU@github.com': To https://github.com/SOMJANG-42MARU/MaruKeyword.git ! [rejected] master -> mas

somjang.tistory.com