“找不到头下面的头/头”在我推送提交CR / CRLF更改后 [英] "HEAD not found below refs/heads" after I push commit with CR/CRLF changes

查看:183
本文介绍了“找不到头下面的头/头”在我推送提交CR / CRLF更改后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有本地存储库和一个远程裸仓库。我对本地文件进行了更改,其他人也进行了更改,但他只是向我发送了文件。我将它们复制粘贴到我的本地树中并承诺。提交时,我收到了复制粘贴文件的消息


LF将被CRLF替换


我刚刚提交了所有文件,并将它们推送到远程裸存储库。在远程运行时,我运行

  git branch 

我得到下一个错误信息

  HEAD在refs / heads下面找不到! 

现在看来,这是因为这些文件带有CR而不是CRLF。



有什么建议吗?将感谢任何关于如何处理这种情况的帮助/解决我的回购问题。

它看起来像您远程的HEAD 指向无效的分支。您可以查看它指向的内容:

  git symbolic-ref HEAD 

并修正它以指向一个有效的分支:

  git symbolic-ref HEAD refs / heads / branch-that-exists 


I have local repository, and a remote bare repository. I've made changes to my local files, and other guy has made changes too, but he just sent me files. I've copy-pasted them in my local tree and committed. On commit I've got messages on files that I have copy-pasted

LF will be replaced by CRLF

I've just committed all the files and pushed them to remote bare repository. And when on remote I run

git branch

I get the next error message

HEAD not found below refs/heads!

Now it seems to me that this is because of these files with CR instead of CRLF.

Any suggestions? Will appreciate any help on how to handle such situations/fix my repo.

解决方案

It looks like the HEAD on your remote is pointing to an invalid branch. You can view what it's pointing to with:

git symbolic-ref HEAD

and fix it to point at a valid branch with:

git symbolic-ref HEAD refs/heads/branch-that-exists

这篇关于“找不到头下面的头/头”在我推送提交CR / CRLF更改后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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