删除Git中的损坏名称(Dropbox冲突副本) [英] removing broken names in Git (dropbox conflicted copy)

查看:165
本文介绍了删除Git中的损坏名称(Dropbox冲突副本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把我的回购保存在保管箱中,有一天(见下面的日期)它变得疯狂了。现在我每次尝试自动填充分支名称时都会收到这些警告。

  warning:忽略ref名称为refs / heads / develop (MacBook Pro的冲突副本2015年2月28日)
警告:忽略ref名称为refs / heads / master(MacBook Pro的冲突副本2015-02-28)
警告:忽略ref名称为refs / remotes / origin / develop(MacBook Pro的冲突副本2015-02-28)
警告:忽略ref名称为refs / remotes / origin / master(MacBook Pro的冲突副本2015-02-28)
警告:忽略名称为refs / remotes / production / master的ref(MacBook Pro的冲突副本2015-02-28)

我如何解决这些警告?



注意:对于所有重复触发快乐的人 - 这不是重复!我只是想删除上面的参考,以停止获得警告。 git repo完好无损

解决方案

当dropbox发现冲突的文件时,它将这些文件重命名为文件名(冲突的副本)(你可能知道)。所以你只需要重新命名这些文件:



这可能是一个相当微妙的练习,因为你会在你的git目录中搞乱;首先更好地获取整个存储库的副本。现在进入这个目录
$ b $ pre $ cd $ cd $回购gt / git / refs / heads

在那里你会发现那些重命名的文件。您必须检查要保留哪一个(正常或相冲突的副本),并删除不需要的,将冲突副本重命名为必要副本。您必须在其他目录中执行相同的操作:


  • /。git / refs / remotes



编辑
您会发现每个文件都包含它们指向的提交的散列。所以如果你想检查哪一个要保留;检查哪些提交确实存在,以及您希望指向哪些引用。


I save my repo in dropbox, and one day (see date below) it went crazy. Now I get these warning every time I try to autocomplete a branch name

warning: ignoring ref with broken name refs/heads/develop (MacBook Pro's conflicted copy 2015-02-28)
warning: ignoring ref with broken name refs/heads/master (MacBook Pro's conflicted copy 2015-02-28)
warning: ignoring ref with broken name refs/remotes/origin/develop (MacBook Pro's conflicted copy 2015-02-28)
warning: ignoring ref with broken name refs/remotes/origin/master (MacBook Pro's conflicted copy 2015-02-28)
warning: ignoring ref with broken name refs/remotes/production/master (MacBook Pro's conflicted copy 2015-02-28)

How do I fix these warning?

Note: For all the duplicate-trigger-happy people - this is not a dup! I just want to remove the references above to stop getting the warning. The git repo is intact

解决方案

when dropbox finds conflicting files, it renames those to filename (conflicted copy) (as you might know). So you just have to rename again those files:

This might be a rather delicate exercise since you will be messing inside your git directory; better take a copy of your whole repository first. Now go into this directory

cd <repo>/.git/refs/heads

where you will find those badly renamed files. You'll have to check which one to keep (the normal or then conflicting copy), and remove the unwanted, renaming the conflicting copies as neccesary. You'll have to do the same in the other directory:

  • /.git/refs/remotes

EDIT each of the files you'll find just contains the hash of the commit they are pointing to. So if you want to check which one to keep; check which of the commits really exists, and where you want those references to point to.

这篇关于删除Git中的损坏名称(Dropbox冲突副本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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