형상관리/GIT / / 2022. 2. 13. 23:46

[Git] ! [rejected] master -> master (fetch first) 에러 해결

git push를 진행하다가 error가 발생하여 포스팅합니다.

 

error 문구

 ! [rejected]          main -> main (fetch first)
error: failed to push some refs to 'https://github.com/

기존 데이터가 손실될 수 있어 push를 막은 것이다.

해결 방법

$ git push origin +master

위 코드로 강제 push 진행

본인은 +main으로 진행

반응형

'형상관리 > GIT' 카테고리의 다른 글

[GIT] fatal: The remote end hung up unexpectedly 에러 발생  (0) 2022.02.10
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유