简体   繁体   中英

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 ?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM