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
3
votes
1 answer
Specify insert order for fragments
In P4Merge, if I select multiple colored icons in the right-hand pane while holding SHIFT (the blue icon corresponds to 'theirs' file, yellow - to 'base' and green - to 'mine'), all the corresponding fragments are inserted into the result:
But, the…

ivan_pozdeev
- 33,874
- 19
- 107
- 152
3
votes
3 answers
Resolve git merge conflict by renaming one of the files
I'm using Flyway to keep track of database changes, and git for version control.
Flyway depends on migration scripts, which are named with increasing numbers for each migration.
Now I have the following situation: two features were developed on two…

Bob
- 5,510
- 9
- 48
- 80
3
votes
2 answers
When someone has cherry-picked from my git commits and made commits of their own, how do I merge?
Suppose I fork someone's git repo and make commits A, B, C, and D. The persom who I forked from then cherry-picks A and C, which therefore become A' and C'. He also makes commits X, Y, and Z of his own. So after all this, my branch has A B C D, and…

Ryan C. Thompson
- 40,856
- 28
- 97
- 159
3
votes
2 answers
Git merge fails unexpected
I've implemented automated merging script in Python. It should merge branches automatically and create pull requests if there are some merging conflicts.
Part of my script looks like:
from subprocess import check_call, CalledProcessError
# E.g.…

smart
- 1,975
- 5
- 26
- 46
3
votes
1 answer
Resolving a part of conflict in a file in GIT
The scenario that i would like to discuss is
I have a merge repository which is shared repository where developers will cd into to resolve merge conflicts.
there are 2 or more merge conflicts in a single file.
each conflict has to be resolved…

Senthil A Kumar
- 10,306
- 15
- 44
- 55
3
votes
2 answers
Are there any shortkeys to Merge conflict in visual studio
I want to do the below:
select the next conflict (like an F8 will be great)
choose local or server (l or s or both)
move to next conflict. (again by pressing F8)

Ziaullah Khan
- 2,020
- 17
- 20
3
votes
0 answers
EGit marks files as having conflicts but the Merge Tool editor shows no red markers
When I merge master down into my dev branch, EGit shows files in conflict. So I go to the Git Staging view, where the conflicting files are shown under "Unstaged Changes" with a red conflict marker on their name. For each file, I right-click it,…

SantiBailors
- 1,596
- 3
- 21
- 44
3
votes
1 answer
Resolving added and deleted conflicts Git
I have a branch release-x.x.x that I would like to merge into the master. However it has hundreds of merge conflicts when I do a pull request. I think this is due to a Swift 3 migration I performed. Either way I want to use all the versions of the…

KexAri
- 3,867
- 6
- 40
- 80
3
votes
2 answers
Resolving conflicts in SmartGit - Finding conflicting files
I have done a rebase in SmartGit. My respository is marked with a red < rebasing > in SmartGit
If I try to make any new commits I get the message:
Rebase: You must edit all merge conflicts and then mark them as resolved using git add.
This is what…

fixingstuff
- 559
- 2
- 7
- 18
3
votes
0 answers
Git merge fails to identify all conflicts correctly
I've had a strange situation where a git merge does not correctly identify all merge conflicts in a file.
If I use a, b, c, etc. to represent blocks of code (which in reality are 100s/1000s of lines of XML), the following happens:
Original Branched…

Stuart Rossiter
- 2,432
- 1
- 17
- 20
3
votes
2 answers
How do I accept both changes in vimdiff hunk?
When resolving merge conflicts, a fairly common pattern is that both I and another person have modified a list or some other section of code which commonly gets appended to. Such…

Gabe Moothart
- 31,211
- 14
- 77
- 99
3
votes
0 answers
Git diff3 file "deleted by us"
On regular merges, merge.conflictstyle diff3 shows me a helpful
<<<<<<< HEAD
changes on HEAD
||||||| merged common ancestors
base
|||||||
changes on branchB
>>>>>>> branchB
How can I show this diff for files "deleted by us" on a merge…

arcyqwerty
- 10,325
- 4
- 47
- 84
3
votes
1 answer
Git merge conflict, but there is no visible difference
I often get conflicts when merging branches that look like this:
<<<<<<< HEAD
private readonly IAdminService _adminService;
=======
private readonly IAdminService _adminService;
>>>>>>> refs/remotes/origin/master
There is no visible…

mrb398
- 1,277
- 4
- 24
- 32
3
votes
1 answer
How can I undo a delete from a previous commit: A Gitastrophy
I've attached an image to illustrate my question.
In Commit C hundreds of files were added. In Commit D a few files were added. When D tried to merge back to develop there was a merge conflict. The developer that resolved the conflict did so by…

micah
- 7,596
- 10
- 49
- 90
3
votes
0 answers
Will git cause major merge conflicts when renaming a folder?
Consider a folder structure on a branch dev like this:
~root/folderX/fileA
~root/folderY/fileB
~root/..
..
What happens if I rename and push a rename of the root folder into the branch?
Does that mean that all the current pull requests will fail to…

ᴘᴀɴᴀʏɪᴏᴛɪs
- 7,169
- 9
- 50
- 81