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
5
votes
1 answer
Git revert creates conflict "deleted by us" due to rename
I'm trying to revert a commit made that modified a file that has since been renamed.
The file modified used to be called bin/internal/call_parser.rb, and is currently called lib/call_parser.rb, and I'm getting in my status after trying to do a…

Andrew Grimm
- 78,473
- 57
- 200
- 338
4
votes
1 answer
How to tell Mercurial to automatically accept "their" version during a merge conflict of any files in a particular directory?
First off, I would prefer not to check in the generated files at all but my manager insists. So, given those constraints I would like to create a mercurial "merge-patterns" that will always take "their files" in all directories named "generated" in…

stephenmm
- 2,640
- 3
- 30
- 48
4
votes
1 answer
Conflict marking confusion when pulling a deleted file with darcs
My confusion arises from the following statement taken from here:
When pulling patches that conflict each other (e.g., change the same part of the file) Darcs detects the conflict and marks it in the repository content. It then lets the user…

davetapley
- 17,000
- 12
- 60
- 86
4
votes
1 answer
How do you finish resolving merge conflicts for a rebasing pull in VS Code?
When I do a git pull --rebase, and there are merge conflicts in my commits, I get the conflict diff view, resolve all the conflicts and stage the files, then what?
I can open a terminal and run git rebase --continue but shouldn't there be a button…

Jeremy
- 2,321
- 3
- 21
- 24
4
votes
0 answers
How to merge a PR w/conflicts in GitHub, **without** merging base into head (the other way) first?
in one of the repositories I work with some other folks on, we use pull requests as a way to manage our merges and sometimes we get merge conflicts (as normally happens). Here's the rub: other developers have been using the GitHub web interface to…

Darren Embry
- 155
- 1
- 2
4
votes
1 answer
How to inspect manual conflict resolution in merge commits where the resolution is performed cleanly using one of the parents
Consider the following git log with the following commits
6752364 * Merge branch 'java-branch'
|\
b9e9e66 | * Add an unrelated file
14a7cb9 | * Change favorite language to Java
7b07a43 * | Change favorite language to C#
|/ …

Henrique Jung
- 1,408
- 1
- 15
- 23
4
votes
2 answers
git merge equivalent of git rebase --onto
I find myself running into a workflow where I do the following:
Create a feature branch ("foo") off of our develop ("master") branch
Work, work , work...
Submit a pull request for foo
While waiting for approval, start work on a related…

Sean
- 393
- 2
- 11
4
votes
2 answers
git stash pop: avoiding stash drop and un-staging steps
Sometimes when running git stash pop there are merge conflicts that need to be resolved. This happens a lot when I have to stash/pop before/after switching branches.
The conflicts are no problem to deal with, but this has two annoying side…

Ken Liu
- 22,503
- 19
- 75
- 98
4
votes
2 answers
Different scenarios for git merge conflicts
I am trying to understand which are the situations when a git conflict can happen after a git merge and how they could be avoided.
I've created a git repository and added a text file to it.
I've added "1" to the text file and committed it to…

Sam Stewart
- 53
- 3
4
votes
1 answer
Git rebase - force overwrite on merge conflict
I am trying to do a git rebase to migrate data to a disconnected SVN clone branch.
Let's say I am trying this with the SoundManager2 repo from Github.
About the first 20 or so of the rebase actions will work fine. After that it will start hitting…

jocull
- 20,008
- 22
- 105
- 149
4
votes
2 answers
Gerrit UI showing status as merge conflict even when there is no conflict
One of my outgoing review was showing merge conflict (not submitted, in process). I fetched the latest from master and then merged that with my feature branch and updated my change list on gerrit. But it is still showing merge conflict.
I have…

imox
- 1,544
- 12
- 12
4
votes
2 answers
How to prevent Git pull from deleting local files
Couldn't find my problem so I figured I would ask.
Myself and another person is working on this repo. My local clone is up to date.
My partner deletes a file 'example.txt', commits and pushes it up.
I come in the next day, do a git status…

Discoveringmypath
- 1,049
- 9
- 23
4
votes
1 answer
VisualStudio 2017 multiple "Keep Target Branch Version"
After some changes I've to merge the master branch in a dev branch where we deleted tons of files, so the "Resolve Conflicts" page lists all of them and it seems I should process each and every conflict choosing "Keep Target Branch Version". Since…

ghiso
- 73
- 7
4
votes
2 answers
How to merge only remote changes in vimdiff?
After forking a Github repository I performed some changes in it. This was quite some time back, now the upstream branch is well ahead. Thus I wanted to merge those remote changes into my forked repo.
I hit upon a merge conflict in one file only. I…

devsaw
- 1,007
- 2
- 14
- 28
4
votes
1 answer
Git merge results in 400 rename/rename conflicts, how do I resolve them quickly?
So, I have a number of Wordpress sites managed with a Git repository, all of which are branches off of a central upstream Git repository. I recently applied a bunch of updates to the parent repo, but one of the child website repos had a plugin…

Libertardian
- 391
- 3
- 5