the_velour_fog
the_velour_fog

Reputation: 2184

why does git give me a CONFLICT error when merging a branch that performed a rename?

I have 2 branches in git

On the breaking_changes branch I renamed a file from user/term_+_bash.sh to dev/gnome-term_+_bash+tmux.sh
I also performed the same rename action (renamed the same file and gave it the same name), but independently on the master branch.
I then tried to merge in the work from the master branch and I got this

$ git merge master 
CONFLICT (rename/delete): dev/gnome-term_+_bash+tmux.sh deleted in HEAD and renamed in master.  
Version master of dev/gnome-term_+_bash+tmux.sh left in tree.
Automatic merge failed; fix conflicts and then commit the result.

git status gives

$ git status
On branch breaking_changes

You have unmerged paths.
  (fix conflicts and run "git commit")

Unmerged paths:
  (use "git add <file>..." to mark resolution)

        added by them:      dev/gnome-term_+_bash+tmux.sh

no changes added to commit (use "git add" and/or "git commit -a")

Im not sure what has happened, How can I resolve this conflict?

Upvotes: 1

Views: 230

Answers (1)

TheGeorgeous
TheGeorgeous

Reputation: 4061

Go to dev/gnome-term_+_bash+tmux.sh and fix the conflicts. Then run

$ git add dev/gnome-term_+_bash+tmux.sh

Then run

git commit -m "your-message"

Upvotes: 1

Related Questions