Cute Happy Ghost
본문 바로가기
etc/git

! [rejected] main -> main (fetch first)error: failed to push some refs to 에러, 강제push명령어

by JENN_tech7 2020. 11. 17.
728x90
SMALL
warning: redirecting to https://github.com/Jenn-tech/Frontend/
To http://github.com/Jenn-tech/Frontend
 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'http://github.com/Jenn-tech/Frontend'
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했는데 갑자기 안되는거다

알고보니 내가 어제 깃홈에서 뭘 수정했는데 그게 원격저장소?랑 데이터가 안맞아서 손실될수도있으니 push를 안해준다는거다

그래서 pull했는데도 풀도안돼 !!

그냥 잃어버려도 되니까 push하라고!!!!
알고보니 강제고 push해버리는 명령어가 있었다

 

//

git push origin +main

//

 

 

 

master면 main을 master로 바꾸면됨

결국 됐다 ㅎㅎ ^_^

728x90
LIST

댓글