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 feature 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:
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.