Following yesterday’s tip, after a Pull Request has been merge, you’ll see a message suggesting that you delete the target branch.
But why would I want to delete this readme-draft? What data do I lose if I delete it?
First, let’s talk about this possible data. The data around the conversation was captured as part of the Pull Request, which was only closed (not deleted), so you can still find it on GitHub.
Second, the data around the commits was merged into master, so that’s not being lost. Stay tuned to the end of this blog post to see a screenshot of these commits sticking around after I delete the branch.
Third, you most likely won’t need to use this branch again. Over time, as your number of merges increases, you’ll have a long list of branches.
Hence it is considered good practice to clean up after your pull requests.
Fourth (and probably most importantly), this is a fundamental difference in how Git works compared to other source control systems. Branches are just pointers to a snapshot in time. More on this in upcoming tips when I start to play with Git command line concepts.
Lastly, you can always restore! Stay tuned to tomorrow’s tip.
Let’s delete this readme-draft branch. Click on the Delete branch button, and volia!
And you can look a few lines up and see that the Pull Request still contains all the commits, regardless that the branch was deleted.