Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a trivial merge in git?

Sometimes when I do a pull instead of a rebase after a simple one file change commit I see the following in the master log:

Trivial merge

But there's no diff of what changed? What's the point of this log message? Did anything change I don't know of? It scares me.

like image 769
Bjorn Avatar asked Dec 01 '09 06:12

Bjorn


People also ask

What is trivial merge?

Trivial merges. In a trivial merge operation, the base contributor and the contributor to which you are merging are the same.

What are the different types of git merge?

Git merging combines sequences of commits into one unified history of commits. There are two main ways Git will merge: Fast Forward and Three way. Git can automatically merge commits unless there are changes that conflict in both commit sequences.

What does it mean to merge in git?

Git merge combines several sequences of commits into a single history. In most cases, that means merging two branches—most often a feature branch and the master branch. In this case, Git will take the commits from the branch tips and try to find a common base commit between them.


1 Answers

git doesn't insert this message into the log at any point. I'm going to take a wild guess and assume that you've seen this message in gitweb.

gitweb prints this message if there is no output from a combined diff. This happens when the only differences were all in chunks were only one side of the merge changed, and this change was brought through unmodified in the merge. This basically means there were no conflicts and nothing magic was added in the merge commit.

like image 180
CB Bailey Avatar answered Sep 27 '22 16:09

CB Bailey