本文介绍了GitHub App& Heroku - 致命:参考格式无效:'refs / remotes / heroku / master'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Git应用程序,每次我打开某个回购站时,都会收到以下错误信息:



任何帮助都会很棒。谢谢。

解决方案

您当然在使用Dropbox在多台计算机之间同步您的项目。在执行同步时,该工具检测到两个文件之间存在冲突,并使用后缀(COMPUTER_NAME的冲突副本DATE)创建备份



不幸的是,冲突的文件是一个引用,根据Git命名约定,引用的名称不能包含空格。请参阅 以获得更多关于如何命名参考的规则的信息。



由于引用只是包含指向提交Sha或其他引用的指针的文本文件,一个复杂的问题。



为了解决这个问题,应遵循以下步骤:




  • 在您的项目目录中,打开 .git / refs / remotes / heroku / master .git / refs / remotes / heroku / master(Richard Burton的冲突版本2012-11-24)文件编辑器中的文件并决定哪些内容是最新的(即哪个是真实的
  • 复制正确的SHA并将其粘贴到名为 .git / refs / remotes / heroku / master 的文件中。 code>

  • 删除 .git / refs / remotes / heroku / master(Richard Burton '的冲突副本2012年11月24日)档案。



注意:你可能有其他文件冲突。为了彻底,在你的项目中启动一个包含冲突副本



注意2:在这种情况下, git ls-remote - heads heroku 可能非常方便,因为它会向远程仓库请求其已知分支。


I am using the Git app and every time I open a certain repo I get this error:

http://cl.ly/image/271p2h283j1g

Any help would be great. Thanks.

解决方案

You're certainly using Dropbox to sync your project among multiple computers. While performing the sync, the tool detected a conflict between two files and created a backup with the suffix (COMPUTER_NAME's conflicted copy DATE).

Unfortunately, the conflicted file is a reference, and according to Git naming convention, the name of a reference cannot contain spaces. See git check-ref-format man page for more information about rules describing how references should be named.

As references are only text files containing pointers to a commit Sha or another reference, fixing this is not a complex issue.

In order to resolve this, the following steps should be followed:

  • Within your project directory, open both the .git/refs/remotes/heroku/master and the .git/refs/remotes/heroku/master (Richard Burton's conflicted copy 2012-11-24) files in a text editor and decide which content is the most up to date (ie. which is the real tip of the remote master branch on Heroku).
  • Copy the correct SHA and paste it in the file named .git/refs/remotes/heroku/master
  • Drop the .git/refs/remotes/heroku/master (Richard Burton's conflicted copy 2012-11-24) file.

Note: you may have other files in conflict. In order to be thorough, launch a recursive search in your project for files which name contains conflicted copy

Note 2: git ls-remote --heads heroku may be handy in this situation as it will request the remote repository about its known branchs.

这篇关于GitHub App& Heroku - 致命:参考格式无效:'refs / remotes / heroku / master'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 12:33