So say I have my master branch, and I create feature-x branch to work on a new feature. I do several commits into feature-x, rebase feature-x from master and then do a non fast-forward merge from feature-x branch to the master branch.
Now what happens to my commit history if I then delete the feature-x branch?
I am doing a non-ff merge because after reading an article (that I agree with) it's easier to keep track of featu开发者_如何学运维re specific changes and the full lifecycle of features by doing non-ff merges.
If I understand you correctly, your history after the merge looks something like this:
A-----------E
\ /
B---C---D
Here, D is the head of feature-x branch after the rebase and E is the head of the master branch after the merge. What happens to master when you delete the feature-x branch? Nothing. Branch is just a pointer to one specific revision (plus some additional data like the reflog) and when you delete it, all you lose is just the pointer, the master will stay exactly the same as it was before you deleted it.
That being said, I'm not sure why are you doing rebase and merge. If you want to keep the history clear, just use merge, you don't need to rebase.
Nothing happens to the history, really. You still have the same sequence (or really directed acyclic graph) of commits, and the branch name will still be included in the merge commit message.
You're just deleting a particular label for a particular commit.
精彩评论