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

问题描述

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

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

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

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

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 01:38