Rename edge case...
- From
John Szakmeister <john@szakmeister.net>
- Date
- Nov 9, 2012, 09:10 UTC
- Message-ID
- <CAEBDL5U+OSTCAqgWoApE_m21Nef24Wqvt78oB6qqV4oEvU0vXQ@mail.gmail.com>
I've been browsing StackOverflow answering git-related questions, and
ran across this one:
<http://stackoverflow.com/questions/13300675/git-merge-rename-conflict>It's a bit of an interesting situation. The user did a couple of
renames in a branch:
foo.txt => fooOld.txt
fooNew.txt => foo.txtMeanwhile, master had an update to fooNew.txt. When the user tried to merge master to the branch, it gave a merge conflict saying fooNew.txt was deleted, but master tried to update it.
I was a bit surprised that git didn't follow the rename here, though I do understand why: git only sees it as a rename if the source disappears completely. So I played locally with a few ideas, and was surprised to find out that even breaking up the two renames into two separate commits git still didn't follow it.
I'm just curious--I don't run into this often myself--but is there a good strategy for dealing with this that avoids the conflict?
Thanks!
-John