foo.txt
git mv foo.txt bar.txt
followed by git add -A
then git commit -m "renamed foo.txt"
git checkout master
git merge branch_A
And with this, I get an merge conflict (rename/delete).
CONFLICT (rename/delete): Rename foo.txt->bar.txt in branch_A and deleted in HEAD
This makes sense and is what I'd expect. However, I'd 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'd expect git to detect that foo.txt was deleted and simply add bar.txt. No conflict.
I've tried using -X rename-threshold, but it has not worked for me. I've tried thresholds 0 and 120 (a number above 100). What am I missing?
Thanks!
P.S. I'm also getting error: refusing to lose untracked file at...
errors. What does this mean?
Can you try with:
git merge -s resolve branch_A
This will enable resolve merge strategy, which does not try to detect renames:
resolve
This can only resolve two heads (i.e. the current branch and another branch you pulled from) using a 3-way merge algorithm. It tries to carefully detect criss-cross merge ambiguities. It does not handle renames.
Also, have you tried looking at similar questions here: