警告:忽略损坏的ref refs/remotes/origin/HEAD [英] warning: ignoring broken ref refs/remotes/origin/HEAD

查看:920
本文介绍了警告:忽略损坏的ref refs/remotes/origin/HEAD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从几天前开始,每次我按 tab 键以bash形式完成分支名称时,我都会看到以下消息:

Since a few days ago, every time I press tab key to complete branch names in bash I see the message:

警告:忽略损坏的裁判ref/remotes/origin/HEAD警告:忽略损坏的裁判refs/remotes/origin/HEAD

warning: ignoring broken ref refs/remotes/origin/HEAD warning: ignoring broken ref refs/remotes/origin/HEAD

例如,这是当我有一个名为feature/foo的分支并按 tab 时看到的内容:

For example, this is what I see when I have a branch called feature/foo and I press tab:

git checkout f

$ git checkout fwarning: ignoring broken ref refs/remotes/origin/HEAD
warning: ignoring broken ref refs/remotes/origin/HEAD
eature/

推荐答案

最近,当我的团队中的某人从远程删除了我们的旧开发分支时,我遇到了这个问题.我运行了此命令以检查HEAD的状态:

I encountered this recently when someone on my team deleted our old development branch from the remote. I ran this command to check the status of HEAD:

$ git symbolic-ref refs/remotes/origin/HEAD
refs/remotes/origin/old_dev

此命令输出旧的开发分支的名称,该名称不再存在.

This command output the name of the old development branch, which no longer exists.

我使用以下方法修复了警告:

I fixed the warnings using this:

$ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/new_dev

(其中"new_dev"是分支名称.将其替换为您要HEAD指向的分支的名称.)

(Where "new_dev" is a branch name. Replace it with the name of the branch you want HEAD to point to.)

这篇关于警告:忽略损坏的ref refs/remotes/origin/HEAD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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