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
4
votes
0 answers

How to manage conflicts in generated files

We are using Django and git. We have i18n enabled and run periodically compilemessages and makemessages. Everybody works in a separate branch and periodically we merge them in master. The problem is when two people need to add translations in their…
Mariy
  • 5,746
  • 4
  • 40
  • 57
4
votes
2 answers

What is the default behaviour of "Resolve using theirs" in git

As per this question, I know it is possible to keep all changes that did not raise any conflict, while using theirchanges for the conflicting changes. What I would like to know is, when using SourceTree (or, if relevant, any git tool or even the…
4
votes
1 answer

Merge conflict in a file that wasn't modified in either branch

When I try to rebase branch featureX on master, I get a conflict in a file (let's call it moduleA/foo) that was not modified in either master or featureX since they diverged! I checked that with the following log command: git log master...featureX…
Jan Warchoł
  • 1,063
  • 1
  • 9
  • 22
4
votes
1 answer

GIT 2 or more merge conflicts in a single file - how p4merge handles?

GIT p4merge - 2 or more conflict in same file I have integrated p4merge with GIT and i came across this situation once. I have a file with merge conflicts. The file say foo.c has merge conflicts in 3 different lines of code (the first line with…
Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
4
votes
2 answers

Resolving conflicts in a team with a big project

I'm interested in learning the best way to resolve conflicts in a big team. For example I have a master branch in which the team has made quite a lot of changes and then I'm rebasing latest changes from the upstream (master and upstream are not…
4
votes
1 answer

Git - coworker somehow overwrote my entire commit while resolving a conflict

This is what he says he did: There was a merge conflict so I chose mine. What I'm seeing is that my changes are totally gone. The commit is there, but if I go on GitHub and click 'history' for the file, there's nothing showing that my changes were…
4
votes
0 answers

How to resolve a merge conflict using conflict markers in a single file

I have a merge conflict marked by my source code management system like this. In this case it's quite trivial to resolve it using any editor, but my question is: Which tool can be used to show the "local copy", "common ancestor" and "merged in…
Holger Jakobs
  • 984
  • 3
  • 11
  • 32
4
votes
1 answer

Why does re-merging result in a repeated merge conflict in git?

Let's say we have a "master" branch with say 1000 of commits over 2 years. We have a long-lived feature branch "feature1", about 2 months old (branched from master at that time), with 100 commits. We continue work on both master and feature1 and…
Will
  • 6,601
  • 3
  • 31
  • 42
4
votes
3 answers

Why does a conflict occur for only one commit instead of two in my rebase operation?

I have rep1 repository with two commits on master branch. These commits have file.txt with the following content: line1 line2 I clone rep1 into rep2 and checkout remote branch as tracking: git checkout --track rep1/master Then in this repository I…
Max Koretskyi
  • 101,079
  • 60
  • 333
  • 488
4
votes
3 answers

Fixing a committed unresolved merge conflict

There are some files in the repository that contain the merge conflict syntax with HEAD and another commit. Those files were somehow committed and I cannot view the log now. I searched and found the command to merge with "git merge -X theirs" on the…
Koci Kocev
  • 79
  • 2
  • 2
  • 7
4
votes
2 answers

Xcode merge two branch Git

I have two branch and they are called as NewFeature1 and subFun100. subFun100 is a branch created from previous commit in NewFeature1. Now, I have fixed code in subFun100 and I want to merge back into NewFeature1 branch. But, I have conflict like…
Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120
4
votes
2 answers

Why do I need to do a 'git add ' after resolving merge conflicts?

I've come here even after looking at this link - How to resolve merge conflicts in Git? and many other links. Everywhere, it is mentioned that you need to do a 'git add' after resolving the conflicts in a text editor. I've been using git for a few…
Devesh
  • 859
  • 8
  • 17
4
votes
1 answer

How to merge master containing reverted commits to branch

I have master branch with initial state: touch file git add file git commit -m "initial" Then I did some changes: echo "123" >> file git commit -am "feature1" which really belong to a feature branch, so I branched: git branch TEST and reverted…
NSPKUWCExi2pr8wVoGNk
  • 2,449
  • 2
  • 22
  • 26
4
votes
1 answer

Why does git does not merge some changes?

We ran into a strange git merge issue. We have 2 repos (simplication below). The PublicRepo is where we do most development on and every now and then we pull/merge changes into PrivateRepo. …
4
votes
2 answers

How Does GitHub Merge Web-Based Wiki Edits With Ones Through The Repository?

I'm toying with the idea of providing some kind of Git access to resources used by a SaaS application to it's users. This will allow users to edit and push content through the Git interface as well as through the application's native web-based…
daveaglick
  • 3,600
  • 31
  • 45