简体   繁体   English

在GIT上,推动合并与合并

[英]on GIT, pushing merges with merges

I have 3 branches: A, B, C 我有3个分支:A,B,C

Usualy when i am to update my Origin I go to Master, merge the branch I've finished, and push. 通常,当我要更新原点时,我去找Master,合并我完成的分支,然后推送。

Now, I had branch A, work, done. 现在,我已经完成了分支A的工作。 Went to branch B, merged A, work, done. 去了分支B,合并了A,工作完成了。 Went to branch C, merged B, work, done. 去了分支C,合并了B,工作完成了。

If i go to master and merge C and push to origin, can I delete already A, B and C ? 如果我去掌握并合并C并推到原点,是否可以删除A,B和C?

Well, it sounds like you can. 好吧,听起来好像可以。 If you want to be sure, you can delete the branch with the -d (small "d") option: 如果要确定,可以使用-d (小“ d”)选项删除分支:

$ 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. 如果$BRANCH所有提交都未合并到master ,则会出现错误,除非您使用-D (大“ D”)选项,否则无法删除该分支。

yes, once you merged c to Master, you can delete a,b,c as final code will be on Master. 是的,将c合并到Master后,您可以删除a,b,c,因为最终代码将在Master上。 However, it doesn't cost you to keep these branches, if you would decide to roll back to some point. 但是,如果您决定回滚到某个点,则保留这些分支并不需要花费成本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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