개발/Git

[Git] error: failed to push some refs to 'github주소'

방로그 2022. 2. 25. 16:04

To https://github.com/aurpo1/aurpo1.github.io.git
 ! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/aurpo1/aurpo1.github.io.git'
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 했다가 다시 push 하라고 했는데... 그래도 해결 안 됨.

 

 

[해결방법]

 

git push origin +main

 

 

으로 하면 해결 되었다.README.md나 gitignore 파일 때문이라는데그래서인지 원래 만들어두었던 README.md 파일이 사라졌다.허허