Git-如何从结帐自动完成中删除分支 [英] Git - how to remove branch from checkout autocomplete

查看:57
本文介绍了Git-如何从结帐自动完成中删除分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过 git branch -d分支名称删除了一些本地分支,但是它们仍然存在于自动完成中(当我放入 git checkout 时,然后按标签键,我在列表中看到所有已删除的分支.

I've deleted some local branches via git branch -d branchname, but they are still exist in autocomplete (when I put git checkout, then press tab key, I see all deleted branches in list).

我尝试制作 git gc git prune ,但没有任何变化.

I've tried to make git gc and git prune, but nothing changes.

推荐答案

如果确定您不希望该分支,则可以将其从本地和像这样的遥控器:

If you are sure that you do not want the branch, you can remove it from your local and the remote like this:

$ git branch -D branchname
$ git push origin :branchname

然后它将停止出现在自动完成结果中.

Then it will stop appearing in autocomplete results.

这篇关于Git-如何从结帐自动完成中删除分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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