我在两台不同的计算机上工作(A和B),并将一个常用的git remote存储在dropbox目录中。
假设我有两个分支,master和devel。两者都在追踪它们的远程对应分支origin/master和origin/devel。
现在当我在电脑A上删除了本地和远程的devel分支。
git push origin :heads/devel
git branch -d devel
在电脑 A 上运行 git branch -a
命令,我得到了以下分支列表:
- master
- origin/HEAD
- origin/master
在电脑 B 上运行 git fetch
命令后,可以用命令 git branch -d devel
删除本地的 devel 分支,但无法删除远程的 devel 分支。
git push origin :heads/devel
命令返回以下错误信息:
error: unable to push to unqualified destination: heads/proxy3d
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.
fatal: The remote end hung up unexpectedly
在运行命令之后,git branch -a
仍然列出了远程分支中的 origin/devel。
如何在电脑 B 上清理远程分支?