![[git 오류] - ! [rejected] master -> master , Your branch is ahead of 'origin/master' by 2 commits [git 오류] - ! [rejected] master -> master , Your branch is ahead of 'origin/master' by 2 commits](https://mblogthumb-phinf.pstatic.net/MjAyMDA4MDZfMTA5/MDAxNTk2NzIwMDI5MzE5.xOaA4cuR93OlwLnTNr4CB-OuY7afpdGSa0C4JCH6vrQg.DiZ34n8px_ZcSP4IgsKRlHSmItZlH8bXuWEdPbkiUc4g.PNG.zzang9ha/image.png?type=w2)
깃허브에서 이것저것 테스트를 해보던 중, push를 하려고 하니 다음과 같은 오류가 발생했다.! [rejected] master -> master (fetch first)error: failed to push some refs to ...두 가지 해결방법이 존재한다.$ git push origin master --force force를 통한 강제 push: - 기존 데이터는 보장하지 못한다.$ git pull -> $ git push pull 을 통해 다시 받고, push 만약 pull 후 push로 안된다면, push -f를 사용. $ git pull -> $ git push -f위와 같이 진행하는데, git pull에서 commit이 2개로 생성되었다.Your branch is ahead of 'origin/master' by 2 commits위 문제는 다음과 같이..........
원문링크 : [git 오류] - ! [rejected] master -> master , Your branch is ahead of 'origin/master' by 2 commits