【发布时间】:2012-02-04 16:41:25
【问题描述】:
这可能是一个愚蠢的问题,但我是 git 的新手,并且看到一个不再存在的远程分支。
$ git branch -a
* master
remotes/origin/master
remotes/origin/production
我不相信生产分支远程存在并且无法弄清楚为什么它仍然在本地显示。如何删除/删除此分支?以下是尝试删除它的样子:
$ git push origin :production
error: unable to push to unqualified destination: production
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'git@IP:puppet.git'
我可以签出所谓的远程生产分支,但得到这个:
$ git checkout origin/production
Note: checking out 'origin/production'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at c323996... added powerdns module, no really
我不知道我在做什么。任何帮助将不胜感激。
【问题讨论】:
-
git branch -a在git fetch之后的输出是什么? -
我提出的副本有一个比 manojlds 在这里所做的解释更多的答案。
标签: git