清理旧的远程git分支 - cleaning up old remote git branches
钉钉、微博极速扩容黑科技,点击观看阿里云弹性计算年度发布会!>>>
问题:
Here is my git workflow. 这是我的git工作流程。
I work from two different computers (A and B) and store a common git remote in dropbox directory. 我在两台不同的计算机(A和B)上工作,并将一个通用的git remote存储在dropbox目录中。
Let's say I have two branches master and devel. 假设我有两个分支master和devel。 Both are tracking their remote counterparts origin/master and origin/devel. 两者都在跟踪其远程对方的原点/原点和原点/开发。
Now while on computer A, I delete branch devel - both local and remote - as follows: 现在,在计算机A上,我删除分支开发-本地和远程-如下:
git push origin :heads/devel git branch -d devel
Now if I do git branch -a
on computer A, I get 现在,如果我在计算机A上执行git branch -a
,我得到
master origin/HEAD origin/master
I now go to computer B. Do git fetch
. 我现在转到计算机B。执行git fetch
。 I can remove the local devel branch by 我可以通过删除本地devel分支
git branch -d devel
But I can't remove the remote devel branch. 但是我无法删除远程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 a ff8 re unable to guess a prefix based on the source ref. fatal: The remote end hung up unexpectedly
Doing git branch -a
still lists origin/devel in remote branches. 进行git branch -a
仍会列出远程分支中的起点/终点。
How can I clean up the remote entry of devel from machine B? 如何从机器B清理开发的远程入口?
解决方案:
参考一: https://stackoom.com/question/DMRn/清理旧的远程git分支参考二: https://oldbug.net/q/DMRn/cleaning-up-old-remote-git-branches
- git remote & origin master & 远程分支,git branch
- git删除远程remote分支
- git合并分支成功,但是push失败(remote: GitLab: You are not allowed to push code to protected branches on this pr...
- git branch --set-upstream 本地关联远程分支
- git remote prune origin删除本地有但在远程库已经不存在的分支
- Git新建本地分支与远程分支关联问题:git branch --set-upstream【转】
- Git 删除远程分支报错 error: Could not remove config section 'remote.origin' 解决办法
- Git 清理无效的远程追踪分支
- Git 清理无效的远程追踪分支
- Git remote branch 远程分支管理
- Git 清理无效的远程追踪分支
- git删除远程remote分支
- git之remote branch controller(远程分支控制)
- git删除远程remote分支
- git远程删除分支后,本地remote tracking还有
- git branch --set-upstream 本地关联远程分支
- 同步本地远程分支 git remote prune origin
- Git本地分支与远程分支关联问题(git branch --set-upstream-to=origin/<branch> )
- git远程分支--remote
- git上找不到远程分支,直接切换报错error: pathspec 'origin/XXX' did not match any file(s) known to git.