When merging branches in a version control system, a merge conflict might arise. This tag is for questions about how such conflicts can be resolved.
Questions tagged [merge-conflict-resolution]
755 questions
23
votes
1 answer
GitHub Pull Request complex conflicts
GitHub added a feature about a month ago to resolve merge conflicts on the web interface, however it only works for "simple" merge conflicts:
No conflicts
Simple conflicts
Complex conflicts
In the blog post that introduced the new feature, GitHub…

rink.attendant.6
- 44,500
- 61
- 101
- 156
22
votes
5 answers
How to automatically merge .hgtags in Mercurial?
I have a script running some Mercurial commands in non-interactive mode on a build server. One of the commands merges two branches and there is always a conflict in the .hgtags file during the merge because of the way the build scripts are set…

Alexey Blinov
- 1,684
- 3
- 17
- 25
22
votes
2 answers
"This branch has conflicts that must be resolved" but it's already merged
I merged a PR with the GitHub web interface, which resolved in a successful merge commit.
Afterwards, GitHub is complaining This branch has conflicts that must be resolved. Does anybody know why or how to get the status merged?

Dan
- 787
- 1
- 7
- 20
21
votes
1 answer
Is there a way to see merge conflict on GitHub by comparing branches?
I'm always having a hard time merging branches on GitHub. I admit I'm not that versed in Git CVS so I rather use visual tools like GitHub Desktop and GitHub Website to accomplish my goals.
The way I've defined our dev process is to have 3+N…

Robert Koritnik
- 103,639
- 52
- 277
- 404
21
votes
3 answers
GIT corrupt files (<<<<<<<
I have this in my files after some trouble with VS2012 git-plugin:
using Microsoft.VisualStudio.TestTools.UnitTesting;
<<<<<<< HEAD
using NHibernate;
=======
>>>>>>> dd2c3d7dfe81074e7c5a73f8e4ca2584481a74f1
namespace…

ErikTJ
- 2,001
- 3
- 21
- 38
21
votes
7 answers
Git merge conflict only on version tag in pom.xml
Is there a way to avoid merge conflicts in version tag in pom.xml when merging master into a branch? I have quite a few pom files, 80, and all of them have same version which is different from one in master. It's laborious and time-consuming to…

Abidi
- 7,846
- 14
- 43
- 65
20
votes
2 answers
git merge conflict after git amend - "Your branch and 'origin/master' have diverged"
This is what happens:
After a recent commit to remote master, I make a small trivial change to my local repo
I add git commit --amend and leave the same commit message as HEAD
I try to push the repo to master with git push
And now I get
On branch…

Amit Erandole
- 11,995
- 23
- 65
- 103
20
votes
2 answers
Merging a feature branch that is based off another feature branch
A few days ago I had a master branch with a completely linear history. Then I created a feature branch, which we'll call feat/feature-a. I worked on that branch, then submitted it for code review to be merged into master.
While feat/feature-a was…

Chris White
- 865
- 1
- 9
- 20
19
votes
2 answers
Git compare "base" version with "theirs" version of a conflicted file?
Given a conflicted file foo.txt, how to tell git diff to show changes between the base version of the file and "their" version of the file?
I can see each of the versions via git show :1:foo.txt or git show:3:foo.txt - is there a simple way to…

Rafał Dowgird
- 43,216
- 11
- 77
- 90
19
votes
3 answers
A separate commit for conflict resolution with git merge
I'm trying to merge a big topic branch into the master, but I want a separate commit that shows how the conflict resolution happened. The goal is to have one commit that shows "these files conflicted and how they conflicted" and the next commit…

vmj
- 13,283
- 3
- 18
- 14
18
votes
2 answers
Do I have to commit a merge to make git-rerere record my conflict resolution?
I'm using git-rerere for its intended purpose, to record conflict resolutions between two branches (master and a topic branch) incrementally as those branches develop, without creating unnecessary merge commits. However, even after reading the…

Ryan C. Thompson
- 40,856
- 28
- 97
- 159
18
votes
3 answers
Git conflicted copy error while cloning a repository
I am using dropbox as a git repository.
Now due to some issue in the syncing, there is some conflicted copy present in the git. How do I remove this conflict ?
Due to this conflict I am unable to clone the contents of that repository.
The error I…

Akash Deshpande
- 2,583
- 10
- 41
- 82
18
votes
1 answer
Re-checking for merge conflicts in VSTS (Azure DevOps)
Setup
Master branch policies: When new changes are pushed: reset all approval votes
Create a Pull Request (PR1) from dev branch to master branch
VSTS performs policy checks.
Before the user is able to complete the PR1, another PR (PR2) is…

Metal Wing
- 1,065
- 2
- 17
- 40
18
votes
1 answer
Git GUI on Windows: merging conflicts
I am fluent with Git on the command line but for a specific project, I need to show others how to do things exclusively in the GUI environment. We are using Git for Windows (available at https://git-scm.com/download/win).
I created a file and added…

Merik
- 2,767
- 6
- 25
- 41
17
votes
2 answers
How do you prevent Subversion merging in stages without saying "resolve all conflicts and rerun the merge"?
I am trying to use TortoiseSVN to merge a branch that has been out of the trunk for a very long time. It has been updated with the trunk, but I don't think subversion merge tracking has been working for the entirety of this merge from trunk process.…

digiguru
- 12,724
- 20
- 61
- 87