The best part about git is that itβs easy to try these things for yourself without affecting any servers. Result for the last guy to press:
02:32:54 ~/desktop/tom $ git push To /cygdrive/h/desktop/test ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '/cygdrive/h/desktop/test' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (eg 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. 02:32:54 ~/desktop/tom $ git pull remote: Counting objects: 3, done. remote: Total 2 (delta 0), reused 0 (delta 0) Unpacking objects: 50% (1/2) Unpacking objects: 100% (2/2) Unpacking objects: 100% (2/2), done. From /cygdrive/h/desktop/test 307f68a..2539f44 master -> origin/master error: refusing to lose untracked file at 'John/FileA.c' error: refusing to lose untracked file at 'John/FileA.c' CONFLICT (rename/rename): Rename "FileA.c"->"Tom/FileA.c" in branch "HEAD" rename "FileA.c"->"John/FileA.c" in "2539f448bb15d10f14bef74688dc3470975c2dbf" CONFLICT (rename/rename): Rename "FileA.c"->"Tom/FileA.c" in branch "HEAD" rename "FileA.c"->"John/FileA.c" in "2539f448bb15d10f14bef74688dc3470975c2dbf" Automatic merge failed; fix conflicts and then commit the result
Git is enjoyable and asks which rename is correct. Please note that not all version control systems are capable of detecting such a rename / rename conflict.
source share