如何解决陈旧的git分支-r(删除幻影git分支)? [英] How to fix stale git branch -r (delete phantom git branches)?

查看:418
本文介绍了如何解决陈旧的git分支-r(删除幻影git分支)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ git分支
开发
*特性/ bug_76
主人
$ git分支-r
origin / HEAD - >原产地/主产地
原产地/开发地
产地/特征/工具_IBResponder
产地/主产地
产地/产地$ b $产地/ sculptor_strategy

在本地,我很好。我想删除所有的原产地,所以我尝试:

  $ git push origin:origin / sculptor_strategy 
error :无法删除'origin / sculptor_strategy':远程引用不存在
错误:未能将某些引用推送到'git @ gitlab:pitbull.git'

我做错了什么?
$ b

(Wild Guess)什么是原始陈旧的缓存?



ANSWER



原来是一个红鲱鱼 - 问题是,我的本地缓存过时了,正如我怀疑的那样。这两个答案都可以正常工作。

解决方案

您可能没有启用修剪选项。使用: git fetch --prune


$ git branch
  develop
* feature/bug_76
  master
$ git branch -r
  origin/HEAD -> origin/master
  origin/develop
  origin/feature/implement_IBResponder
  origin/master
  origin/origin
  origin/sculptor_strategy

Locally, I am good. I want to delete all the crud on origin so I try:

$ git push origin :origin/sculptor_strategy
error: unable to delete 'origin/sculptor_strategy': remote ref does not exist
error: failed to push some refs to 'git@gitlab:pitbull.git'

What am I doing wrong?

(Wild Guess) Is some local cache of what's on origin stale?

ANSWER

It turned out to be a red-herring - the problem was, my local cache was stale, as I suspected. Both answers below will work fine.

解决方案

You are probably not fetching with the prune option enabled. Use: git fetch --prune.

这篇关于如何解决陈旧的git分支-r(删除幻影git分支)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆