Git - Conflict resolution

About

In case of conflict during a merge, the working tree files will include a description of the conflict bracketed by the usual conflict markers <<<<<<< and >>>>>>>.

For the marker, Git uses the same style as the one used by the “merge” program from the RCS suite to present such a conflicted hunk.

Resolution

Conflict resolution 1) in Git can be applied:

The whole set

You have reason for the whole set of files:

git stash # keep the modification in a stash branch
git pull # get the last one
git stash pop # Destash the modification

stash is essentially a merge

File by file

When you want to resolve conflict in Git, you use the mergetool

Example: mergetool is not configured but will still open tortoisemerge as I have it alreayd installed on my computer thanks to TortoiseGit

git mergetool
This message is displayed because 'merge.tool' is not configured.
See 'git mergetool --tool-help' or 'git help config' for more details.
'git mergetool' will now attempt to use one of the following tools:
tortoisemerge emerge vimdiff
Merging:
syntax.php

Normal merge conflict for 'syntax.php':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (tortoisemerge):





Discover More
Git - Git (executable|command line)

The git executable where: --git-dir is the location of the repository files --work-tree is the location of the work tree Command Description add Add file contents to the index add--interactive...
Git - Mergetool

The mergetool is a software that resolves a Git conflict. You need to install a mergetool such as: tortoisemerge (tip: make a copy of tortoiseGitMerge), emerge, vimdiff (default) meld, opendiff,...



Share this page:
Follow us:
Task Runner