본문 바로가기

Tech

! [rejected] main -> main (fetch first)

안녕하세요 G1N4입니다 :-)


위에서 고생한 보람도 없이 이번엔 거절당했네요..<branch name>을 main으로 사용했을 때 나타나는 상황입니다, master로 쓰신 분은 아래 코드의 세 번째 줄이 master -> master (fetch first) 로 나타납니다.


[발생상황]

$ git push --set-upstream origin main

To <url>
 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'https://github.com/<ID>/<Rrepository name>'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

[해결완]

$ git push origin +main

그럼 다음 글에서 만나요 ;-)

 

 

[참조링크]

https://donggu1105.tistory.com/104