- I have a file,
foo.txt - Creating and checking the branch 'branch_A'
git mv foo.txt bar.txt , then git add -A , then git commit -m "renamed foo.txt"git checkout master- delete foo.txt and commit.
- Now merging branch_A,
git merge branch_A
And with this I get a merge conflict (rename / delete).
CONFLICT (rename/delete): Rename foo.txt->bar.txt in branch_A and deleted in HEAD
It makes sense and I expect. However, I would like to know if there is a way for git merge to not detect renames, but instead treat them as added / deleted. In this case, I would expect git to detect that foo.txt has been removed, and just add bar.txt. There are no conflicts.
I tried using -X rename-threshold, but it did not work for me. I tried thresholds 0 and 120 (number above 100). What am I missing?
Thank!
PS I also get errors error: refusing to lose untracked file at... What does it mean?
git merge rename
Ken Hirakawa May 16 '11 at 4:47 a.m.
source share