Steps taken
I merged the feature branch back to master and removed the feature branch. But he still appears in the tree.
Result
Visualizing a tree in SourceTree before deleting a function branch: 
Rendering a tree in SourceTree after deleting a function branch: 
The feature branch opens in the left list, as expected, and the label in the tree renderer also disappeared as expected.
Questions
But:
- Why is the purple part still showing?
- What Git commands do I need to run to no longer see the purple part? I probably myself answered this question in the two sections below.
I understand that the final commit in the screenshot above has two parents. But I do not understand why the violet commit that occurred on the feature branch is not in the final merged commit to master (which, I think, means that the violet branch should no longer be visible after it is removed).
Repeating steps from the command line (instead of SourceTree)
I played it on the command line (just to check if SourceTree did what I thought it did), and the last step was the git merge feature . The same situation:

Trial with --squash
I disabled the last merge and tried this:
git merge --squash feature git commit "Squashed merge" git delete -D feature
And now it shows what I would expect in the first place. One straight line and the absence of signs of the feature branch that ever existed:

Question
- How is this merger different from the previous merger?
I suggest that I sort of put together what happens to these mergers after all the trial and error above, but I would appreciate it if someone could really explain in detail what the semantic difference of the above steps is.
git git-branch git-merge
Lernkurve
source share