
These changes are what you see in git diff output, and as always, they have context as well. Git has no real understanding of file contents it is merely comparing each line of text. These changes are (in general) found on a line-by-line, purely textual basis. Git has then found two sets of changes: "what we did" and "what they did". The "base" version is from the merge base between our commit and their commit, as found in the commit graph (for much more on this, see other StackOverflow postings). That is, the merge has identified three revisions (three commits): base, ours, and theirs. To understand what they do, though, you need to know how Git finds, and treats, merge conflicts.Ī merge conflict can occur within some file 1 when the base version differs from both the current (also called local, HEAD, or -ours) version and the other (also called remote or -theirs) version of that same file.

As root545 noted, the -X options are passed on to the merge strategy, and both the default recursive strategy and the alternative resolve strategy take -X ours or -X theirs (one or the other, but not both). The most interesting part here is git merge -X theirs. Git push origin master # again, see below Git merge origin/demo # if needed - see below Git checkout demo # if needed - your example assumes you're on it
Push overwrite master git update#
Hence: git fetch origin # update all our origin/* remote-tracking branches

You are doing three merges, which is going to make your Git run three fetch operations, when one fetch is all you will need. Not really related to this answer, but I'd ditch git pull, which just runs git fetch followed by git merge.
