Is it safe to delete a branch from a github fork once it's been merged upstream?
Solution 1
When you add something to master branch, it's there for good. Merging another branch to master is just adding things from other branch to master.
When you delete that other branch, the history inside the branch is lost if you rebased it. But it does not make much sense anyway, once the changes are in the master branch.
So, you can safely delete your branch if you don't want to continue development within it.
Solution 2
If you're worried about upstream's code magically disappearing if you delete your branch, don't. Once they pull it, it's there (more or less) for good.
Related videos on Youtube
Tim
Updated on September 17, 2022Comments
-
Tim over 1 year
I've only recently tried my hand at forking in github and would like some "best practice" advice.
I created a branch in my fork, and that branch got pulled into master of the upstream project. It no longer appears in the network graph, but it's still there on the github. Is it safe for me to delete this branch on the fork now?
Edit: Just to clarify, I'm checking if this conflicts with github's "don't change history" rule.