Server
error: failed to push some refs to 'git repository path'
void
2019. 9. 11. 10:00
실제 프로젝트에는 절대 적용하면 안되는 방법
git repository에 있는 파일을 압축파일로 다운로드받고 푸쉬하려니 아래와 같은 에러가 발생했다.
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/.git'
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 commit 기록 날리고, 푸쉬하는 방법이다.
git push -f -u origin master
출처 : https://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge
원래는 repository에 있는 코드를 내 컴퓨터에 pull한 후에 push하는게 정석이지만,
공부용이기도 하고 이미 많은 작업을 했기에 위에 방식대로 repository 기록을 날렸다.