Reputation: 11401
In order to implement a new functionality, I created a branch, developed all the code, tested it and committed it,pushed it and created a pull request. The request was accepted and the merge took place and everything is working as expected.
But my branch is still here... I was under the impression that once merged it would just disappear, because, well, the code is the same as the main repo...
So my question is: how can I make the branch be "swallowed" by the main branch? Or should I delete it? What is the common scenario here? Do projects simply abandon them?
Upvotes: 1
Views: 1803
Reputation: 158110
Just because a branch has been merged into the master branch, it does not necessarily mean that not more commits will follow in this branch. Even if it is not the case in your particular use case. If you don't need the branch anymore, delete it:
git checkout master
git branch -d branch_name
git push --delete origin branch_name
If you have not already pulled the merged upstream master git branch -d branch_name
might complain about the fact that you are attempting to delete a branch which has not already merged before. In that case pull upstream master or use git branch -D branch_name
to enforce deletion.
Upvotes: 2