깃허브 failed to push some refs to~,Updates were rejected because the remote contains work that you do not have locally 에러

    깃허브 failed to push some refs to~,Updates were rejected because the remote contains work that you do not have locally 에러

     

    repository를 만들때 README.me를 만들어서 발생한 에러로,

    이유는 내 로컬 repository가 아직 README.md가 새로 commit된 것을 모르기 때문에

    아래와 같은 에러가 나오게 된다.

    Updates were rejected because the remote contains work that you do not have locally



    해결방법

    git push **-u** origin master

    git push -f origin master

    위push는 일반적인 push와 조금 다른 -f가 쓰여져 있는데, 이는 force로 강제로 push하는 것 같다.

     

     

    댓글

    Designed by JB FACTORY