Don't let git rename files during merge

2019-07-27 06:45发布

问题:

I'm trying to merge branch 'a' into branch 'b'. I have files that are the same in each branch, where the only difference is the filenames. When I merge 'a' into 'b', the filenames for 'a' overwrite 'b', is there a way to stop this?

These files are also in a directory, it would be good if I could prevent any file being renamed in that directory.

Or alternatively, is there a way to restore the old filenames after the merge?

回答1:

Seems like:

git merge -X --no-renames a

Did the trick, thanks to the people on #git on irc.freenode.net



标签: git merge rename