Fabiano Soriani
Fabiano Soriani

Reputation: 8562

on GIT, pushing merges with merges

I have 3 branches: A, B, C

Usualy when i am to update my Origin I go to Master, merge the branch I've finished, and push.

Now, I had branch A, work, done. Went to branch B, merged A, work, done. Went to branch C, merged B, work, done.

If i go to master and merge C and push to origin, can I delete already A, B and C ?

Upvotes: 0

Views: 83

Answers (2)

Stewie Griffin
Stewie Griffin

Reputation: 9317

yes, once you merged c to Master, you can delete a,b,c as final code will be on Master. However, it doesn't cost you to keep these branches, if you would decide to roll back to some point.

Upvotes: 1

mipadi
mipadi

Reputation: 410542

Well, it sounds like you can. If you want to be sure, you can delete the branch with the -d (small "d") option:

$ git branch -d $BRANCH

If all the commits in $BRANCH haven't been merged into master, you'll get an error that you can't delete the branch unless you use the -D (big "D") option.

Upvotes: 1

Related Questions