That means the merge is a fast-forward one: it simply moves master HEAD to feature branch HEAD.
The blog post "Merge or Rebase?" (August 2012) mentions:
You can turn fast-forward merges off in SourceTree so that a merge commit is always created if you want - check the 'Create a commit
' option in the Merge
dialog or set it globally in Preferences > Git
.]
Note: if you are using git-flow
with SourceTree, then the merge would always be a fast-forward one if fast-forward is possible: see this thread.
The screenshot added by the OP reveals a non-fast-forward merge, with:
- a merge commit in master history
- commits done in feature branch
So A-D
is in master
, while B-C
remain in feature
branch: you don't have to "remove" B-C
from master
history.
The current branch (master
) only has A-D
. The feature
commits are only visible as a context, to explain where the merge commit D
is coming from.
Note: this (the merge commit) is represented in GitHub with both parents, meaning including the latest commit of the the merged branch: it is a "feature" from GitHub, not an accurate representation of master
history.
See for instance the commits in the master
branch of the Git repo itself: each merge commit is followed by one commit from the merged branch.
In the case of the second screenshot, GitHub displays the commits from the merged branch, but those commits aren't part of the history of master (a git log master
wouldn't list them).
It is a feature from GitHub, not an exact view of the master
log.
Note bis: those merged commits are displayed by GitHub according to their date.
If they are recent, you see them right under the merge commit, if they are older, you see them further down in the commit history list of the master
branch.
The OP Asaf Maoz adds in the comments:
when I used smart git I had an option to merge branches and see only one commit in my master branch (similar to those in your link) - the merged commit,
This doesn't seem to be supported yet in ST (see the ST forum).
Even displaying the name of the current branch isn't there yet (SRCTREE-1925
)
I didn't change anything in my github account, so it must be in the ST. maybe this option does not exist in ST
Yes: each tool chose its graphical display of a git log
.