为什么Git使用冒号(:< branch>)来删除远程分支 [英] Why Git use the colon (:<branch>) to delete remote branch
问题描述
我在考虑为什么Git命令使用
git push< remote> :< branch>
像
git push origin:featureA
删除远程服务器中的featureA分支。我很感兴趣,为什么把冒号作为删除标志。它与
git branch -d
为什么不做类似于
还是有我以前从不知道的冒号符号的深层含义? 它本身不是 refspec格式为 (可选+用于非快进) 所以,当你做一些类似于 PS:请注意, I am thinking about why the Git command use Why don't make something like or there are deep meaning of colon symbol that I never know before? It is not the meaning of the The refspec format is (optional + for non-fast forward) So when you do something like PS: Note that the refspec of 这篇关于为什么Git使用冒号(:< branch>)来删除远程分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! git branch -d --remote origin< branchname> $ c
:
的含义,而是存在的或在它之前缺少的。
+< source>:< destination>
git push origin:featureA
的东西时,你需要指定一个空的源代码,并且基本上将目标设置为空白或删除它。
:
的refspec或没有任何意思,但并不意味着什么也不是。它使得git推送匹配分支:对于本地存在的每个分支,如果远程端已经存在相同名称的分支,则更新远程端。git push <remote> :<branch>
like
git push origin :featureA
to delete featureA branch in the remote server. I am interest that why make the colon as the delete flag. It is so difference fromgit branch -d <localbranch>
git branch -d --remote origin <branchname>
:
per se, but what is present, or rather absent before it.<+><source>:<destination>
git push origin :featureA
, you are specifying an empty source ref and basically making the destination "empty" or deleting it.:
or nothing doesn't mean push nothing to nothing however. It makes git to push "matching" branches: for every branch that exists on the local side, the remote side is updated if a branch of the same name already exists on the remote side.