2

In my repo I have the master and a new_branch. I add files to the new one, commit and push them to remote repo. Then I've merged the new one into the master with the following steps:

git checkout master (up-to-date)
git merge new_branch (no conflicts)

I see the fast-forward merge and all new files. No errors, no conflicts. Then:

git checkout master

tells me my local repo is 2 commits ahead against origin/master, so I push. Now if I checkout master, it is up to date but, I can't see the merge I've done:

git log --decorate --graph

The only commmit it shows is the one I 've done into the new_branch just before merging it. And also graphically there is no evidence of the merge. Is it normal?

glc78
  • 339
  • 1
  • 4
  • 19

1 Answers1

4

A fast-forward merge happens when the only difference between the base branch and the branch being merged is the new commits in the new branch. In that case, git simply moves the head of the base branch to the most recent commit in the new branch. There is no merge commit. This is normal behavior. If you prefer a merge commit instead, you can specify --no-ff flag during git merge --no-ff.

Kon
  • 3,825
  • 3
  • 17
  • 35