You can rebuild a branch when renaming is detected:
git rebase --strategy-option="rename-threshold=10" master
Edit: With Git 2.8.0, the term "rename-threshold" is deprecated in favor of "find-renames".
I am currently using Git 2.7.4, and therefore I could only verify that the above command worked in my case - you might need to use the term “find-rename” if the above command doesn’t work in your case your new version of git ...
In this example
- the current branch is redistributed to
master 10% renaming threshold specified- changes in
master to the source files will be placed in new (renamed) files (as opposed to a simple git rebase master ). - note how the syntax differs from the similar rename function found in the
git diff , git log and git merge commands
The git rebase documentation is not very clear on this aspect of renaming. I thought I read in another command somewhere that the term “rename-threshold” was deprecated, although in this context, find-renames did not seem to work as a synonym, so if anyone knows of a better way to run the same commands, please specify so :)
Chasemoskal
source share