Itay Moav -Malimovka
Itay Moav -Malimovka

Reputation: 53597

What happens to a branch once I merge it?

I create the master and then a branch (named the_branch) out of it. I modified the the_branch and then

git checkout master  
git merge the_branch  
git commit -m "..."  
git push

Seems like code was merge and all seems right. My question, if I want the_branch to "die" once I merge it, do I have to explicitly delete it, or there is a way that once I merge a branch into another it dies by default?

Upvotes: 1

Views: 134

Answers (1)

chicks
chicks

Reputation: 2463

local branch

git does not delete the branch unless you tell it to with

git branch -d the_branch

remote branch

as seen here:

To delete it from the remote in old versions of Git use:

git push origin :branchname

In more recent versions of Git use:

git push --delete origin branchname

Upvotes: 1

Related Questions