That's a default merge commit message. It doesn't take anything special to get it - just do any nontrivial merge into master:
- o - o - X (master)
/
o - o (topic)
The default commit message for commit X will be "Merge branch 'topic'". If you merge into a branch other than master, the default message is "Merge branch '<merged-branch>' into '<branch>'"
.
I'm not sure why you're asking about "fixing" and "avoiding" this. It's a very reasonable default message for a merge commit. If you'd like a more detailed merge commit message, you're certainly welcome to provide one. (The two primary ways are to use git merge --no-commit
followed by git commit
, or git merge
followed by git commit --amend
to edit the message.)
Perhaps you're used to doing only fast-forward merges? (Those are trivial merges, where the commit you're merging has your current branch as ancestor, so all git has to do is move the branch forward through history.) Those don't generate merge commits, so there's no commit message.
(By the way, pushing has nothing to do with this - all it does is copy information from one repo to another. It doesn't ever create commits.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…