Search code examples
gitbranchmessage

Git merge from master commit message


In general, when I merge a branch from the master branch git automatically generates a commit message like this :

Merge branch 'master' into name-of-my-branch

but last time it generates a commit message like :

Merge branch 'master' of git.domain.com:repo-name

What caused this unexpected merge commit message?


Solution

  • First git will leave out the "into xxx" part if that branch is "master".

    The "of xxx" part usually comes from a git pull which merges the remote branch into the current branch.

    In your case you were on your local master branch. You did some local commits and then did git pull, which merged upstream changes onto your master branch.

    Have a look at gitk or git log --graph to get a better idea what is going on.

    Also using git pull --rebase might be a good way to get rid of these additional (usually unwanted) merge commits. (I usually define git config --global alias.up pull --rebase and use git up afterwards to update my local branch.)