Questions tagged [merge-conflict-resolution]

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.

See also

755 questions
5331
votes
36 answers

How do I resolve merge conflicts in a Git repository?

How do I resolve merge conflicts in my Git repository?
Spoike
  • 119,724
  • 44
  • 140
  • 158
568
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
  • 7,753
  • 8
  • 35
  • 39
350
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
  • 6,266
  • 7
  • 39
  • 80
312
votes
12 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
  • 4,296
  • 3
  • 27
  • 34
283
votes
4 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
168
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,781
  • 3
  • 12
  • 5
139
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
  • 3,103
  • 4
  • 27
  • 28
130
votes
9 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
  • 4,041
  • 9
  • 36
  • 72
128
votes
6 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
  • 8,105
  • 17
  • 68
  • 102
99
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,091
  • 1
  • 7
  • 5
84
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
75
votes
5 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
  • 25,216
  • 29
  • 151
  • 297
73
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,093
  • 1
  • 12
  • 18
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
  • 7,518
  • 7
  • 48
  • 64
56
votes
5 answers

git remove file from stash

I have a stash with a bunch of files in it. But I can't apply my stash because of a conflicting file. I've identified the problematic file in my stash and I want to remove it. How can I remove a single file from a stash without destroying the entire…
user773737
1
2 3
50 51