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]
641 questions
5011
votes
38 answers
How to resolve merge conflicts in Git repository?
I want to resolve merge conflicts in my Git repository.
How to do that ?
Spoike
- 112,352
- 42
- 133
- 155
493
votes
12 answers
Resolving a Git conflict with binary files
I've been using Git on Windows (msysgit) to track changes for some design work I've been doing.
Today I've been working on a different PC (with remote repo brian) and I'm now trying to merge the edits done today back into my regular local version on…
Kevin Wilson
- 6,933
- 6
- 32
- 39
301
votes
9 answers
INSERT IF NOT EXISTS ELSE UPDATE?
I've found a few "would be" solutions for the classic "How do I insert a new record or update one if it already exists" but I cannot get any of them to work in SQLite.
I have a table defined as follows:
CREATE TABLE Book
ID INTEGER PRIMARY KEY…
SparkyNZ
- 5,336
- 6
- 33
- 67
238
votes
11 answers
Why does git say "Pull is not possible because you have unmerged files"?
When I try to pull in my project directory in the terminal, I see the following error:
harsukh@harsukh-desktop:~/Sites/branch1$ git pull origin master
U app/config/app.php
U app/config/database.php
U app/routes.php
Pull is not possible because you…
Harsukh Makwana
- 3,420
- 2
- 22
- 29
237
votes
3 answers
How do I fix a merge conflict due to removal of a file in a branch?
I have create a dialog branch and when I try to merge it to master branch. There are 2 conflicts. I don't know how to resolve CONFLICT (delete/modify). Can you please tell me what to do?
$ git checkout master
$ git merge dialog
CONFLICT…
n179911
126
votes
6 answers
Git resolve conflict using --ours/--theirs for all files
Is there a way to resolve conflict for all files using checkout --ours and --theirs? I know that you can do it for individual files but couldn't find a way to do it for all.
exe163
- 1,361
- 3
- 10
- 5
122
votes
3 answers
How to interactively (visually) resolve conflicts in SourceTree / git
I'm using (Windows) SourceTree for my git project. I can do it in either command prompt or Linux terminal.
But, I'm wondering whether there is a nice way to interactively and visually resolve conflicts. For example, if pull detects conflicts,…
Nullptr
- 2,527
- 4
- 23
- 27
110
votes
5 answers
Git merge left HEAD marks in my files
I tried to merge a file in the command line using Git, when an error message appeared telling me the merge was aborted.
I thought that was the end of it, but then I realized there are gitmarks in my files. Like so:
start =
expression
validchar…
lowerkey
- 7,275
- 16
- 65
- 100
92
votes
3 answers
How to get Visual Studio to open Resolve Conflicts window after a TFS Get
When I do a Get Latest in Visual Studio, if there are conflicts, there is nothing that is displayed to me to make it obvious. Invariably I think everything is OK, do a build, and often the build works.
The onus is always on me to remember to look…
valerie
- 1,021
- 1
- 7
- 5
90
votes
8 answers
Cannot checkout, file is unmerged
I am trying to remove the file from my working directory but after using the following command
git checkout file_Name.txt
I got the following error message
error: path 'first_Name.txt' is unmerged
What is that and how to resolve it?
Following is…
Naseer
- 3,147
- 5
- 31
- 61
66
votes
1 answer
Git merge: accept theirs for multiple conflicts
I'm trying to merge a git branch (test-development) back into master. There are lots of merge conflicts but I want as many as possible to be resolved via --theirs. Is there a way to tell git to merge with --theirs in bulk?
SecondGear
- 1,013
- 1
- 12
- 17
65
votes
4 answers
How to resolve merge conflict in pull request in VSTS?
I've created pull request I got into this:
"Approve" button does nothing and complete is disabled.
How do I resolve this confligt in pull request?
Liero
- 19,054
- 16
- 100
- 195
61
votes
2 answers
Using Source Tree, rebase with conflict, rebase doesn't work after conflict resovled
I'm using SourceTree as my git tool on Windows.
I have a main branch and a feature branch and I can't get SourceTree to perform a rebase when I have a conflict.
main looks like:
c1 -> c2 -> c4 -> c5
feature looks like:
c1-> c2 -> c3
I want to…
user4007604
60
votes
5 answers
Merge conflict resolution
When there's a merge conflict in Git, junk like the following is inserted into the conflicting files. Three questions:
How do you read these annotations?
What are some strategies to use when fixing these merge conflicts?
Is there a GUI tool for Mac…
Chris Calo
- 6,567
- 7
- 44
- 57
51
votes
8 answers
How to avoid git conflicts in a team?
We are some developers who work on same project and we use git for the project. If two or more of us happen to work on same file, we receive git conflicts which are hard to deal with, sometimes changes done by one developer are lost when these…
Dev01
- 3,544
- 5
- 27
- 43