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
6
votes
1 answer
How do I resolve the same merge conflict in numerous files?
Assume I have this one conflict in 200 files:
<<<<<<< HEAD
/* Version 1.0.0 */
/* Date 2017-05-30 */
=======
/* Version 1.0.1 */
/* Date 2018-11-30 */
>>>>>>> release/1.0.1
I know for sure…

eckes
- 64,417
- 29
- 168
- 201
6
votes
5 answers
Anyway to automatically merge or concatenate hgtags (Mercurial)?
We are trying to run a chron job that automatically converts seperate CVS modules to mercurial modules and finally, consolidate those converted mercurial modules to in a single mercurial repo.
I've been trying to find ways to automatically merge…

DavidW
- 301
- 3
- 11
6
votes
1 answer
Github thinks branches are different after merge
I've banged my head against the wall with this Github issue enough to finally come here for help. My repo has two branches of interest: master, which is the currently live release branch, and alternate-testing, which is exactly what it sounds like.…

Dr. Andrew
- 2,532
- 3
- 26
- 42
6
votes
2 answers
git rebase --continue vs. new commit
If I run into merge errors, I usually solve the merge errors, add my files again and use
git rebase --continue
to continue with pulling and pushing.
Now I had some time to take a deeper look into how git works and figured out, that it should be…

julandi
- 85
- 8
6
votes
2 answers
Git pull not possible because of unmerged files
I have just tried replacing the master branch on my server with another branch, as the master was broken, and I couldn't seem to resolve the error...
The branch that I replaced it with is the last working version I had. I did this by running the…

Noble-Surfer
- 3,052
- 11
- 73
- 118
6
votes
0 answers
During git cherry-pick, undo changes to a single file, reverting to my version
I'm doing a cherry-pick for a large commit with multiple files. There are some conflicts, but for some of the conflicting files I'm sure that I don't need any of the changes. I'd just like to revert all changes applied to these files in that commit…

Vincent Sels
- 2,711
- 1
- 24
- 31
6
votes
1 answer
How to resolve conflict of renamed folder of file in git?
I have following problem:
I have some common commit A for two branches Branch1 and Branch2.
Branch1 is a public branch (lies on server)
Branch2 is a local branch
In Branch1 I changed file (BAD_folder/somefile.txt). Changes were pushed to server.…

Alex Aparin
- 4,393
- 5
- 25
- 51
6
votes
2 answers
3-way merge not working on beyond compare 4 with git
I am unable to do a 3-way merge with beyond compare 4 to resolve any git conflicts. When there are conflicts I type
git mergetool
it opens a beyond compare tab but instead of a 3-way merge its a normal diff view.
The version of Beyond Compare is…

Harsha
- 263
- 1
- 3
- 14
6
votes
2 answers
Git merge - Conflict markers missing
Using Windows 7, git 1.9.5.msysgit.1
The tutorials I've read about merge conflicts in Git suggest that failed merges will cause conflict markers to be placed at problematic points in the file. I can't seem to get this to happen. Here is a sample…

abarger
- 599
- 7
- 21
6
votes
1 answer
Can Git automatically handle insertions when resolving merge conflics?
When resolving merge conflicts, most of the time it's because two people inserted at the same point of a file. And I always do the same: Use the new code from the left side, copy the new code from the right side and append it after the code from the…

AndreKR
- 32,613
- 18
- 106
- 168
6
votes
1 answer
Merge conflict, when branches aren't modifying the same line
I'm trying to wrap my head around git conflicts, why does merging these two result in a conflict?
file.txt on branch master:
This is line number one
file.txt on branch feature:
This is line number one
This is line number two

Svetan Dimoff
- 519
- 6
- 24
6
votes
1 answer
git save history of resolved merge conflicts
In our repository, we have two branches that have been diverging for some time now and I need to merge them back together. There will obviously be lots of conflicts, hopefully minor...
(foo )$ git rebase master
First, rewinding head to replay your…

Barry
- 286,269
- 29
- 621
- 977
6
votes
1 answer
Rebase onto upstream changes with non-trivial merge commits present locally
As a developer on php-src I recently find myself in the following situation:
A B C
o---o---o version1
\
o---o-----o---o master
x y D E
o---o---o upstream/master
x y z
So when I do git push --dry-run…

Ja͢ck
- 170,779
- 38
- 263
- 309
6
votes
1 answer
Difference between git checkout HEAD -- filename and git checkout -- filename
Let's begin with a situation.
I stash some changes (5 files) git stash
Change some files
Commit the changes git commit -m "Commit message"
Get the changes back from stash git stash apply
I receive a merge-conflict in 2 files because of the commit.…

Sachin Jain
- 21,353
- 33
- 103
- 168
6
votes
1 answer
How to prevent systematic conflicts when merging Visual C++ 2012 project filters?
When new files are added to a Visual C++ project, the IDE adds them in two locations:
The main project file (e.g. myproject.vcxproj)
The project "filters", a repository of the virtual paths of the solution explorer (e.g.…

Laurent Couvidou
- 32,354
- 3
- 30
- 46