IT/GIT

! [rejected] master -> master (non-fast-forward)

조원태 2017. 11. 22. 15:53
반응형

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to '~~~~~~~~~~~~~~~~~project.git'

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.



자!  깃을 사용하다가 위와 같은 에러가 발생한다.


난감 하다.


A사용자가 _DATA 파일을 만들고 B 사용자가 이 파일을 pull 했다 

그리고 A사용자가 _DATA 파일을 지워고 push  


B 사용자도 비슷한 시간에 _DATA 파일을 지웠다  push는 하지않았다.


정확한 이유는 알지 못하나.. 나에 경우는 이런 상황이었다.


아래와 같이 사용  하면 된다.

git clean -d -fx ""

-x means ignored files are also removed as well as files unkonown to git.

-d means remove untracked directories in addition to untracked files.

-f is required to force it to run.


반응형