如何从 git-svn 中恢复,将不同大小写的重复文件放入存储库中?
Git-svn 允许将重复的文件名(只是大小写不同)添加到我们的 subversion 存储库中。
在 Windows 上,这意味着 subversion 无法检出该文件,并抱怨文件重复。
另一位开发人员从存储库中删除了大小写不正确的版本。 现在,当尝试执行 git-svn rebase 时,我收到一条“无法分离 HEAD”消息,并抱怨相关文件名未被跟踪并需要被覆盖。 删除文件会使 git-svn 抱怨该文件需要更新。
将存储库复制到具有区分大小写文件系统的计算机的唯一解决方案是进行变基然后将其移回吗?
我知道 git-svn 还没有准备好在 Windows 上进行实际工作,但我想从它造成的混乱中恢复过来。
Git-svn allowed for a duplicate filename, just with different case, to be added to our subversion repository.
On Windows this meant that subversion could not checkout the file, complaining of a duplicate.
Another developer deleted the incorrectly cased version from the repository. Now when trying to do a git-svn rebase I get a "could not detach HEAD" message and a complaint about the file name in question being untracked and needing to be overwritten. Deleting the file makes git-svn complain that the file needs to be updated.
Is the only solution to copy the repository to a machine with a case sensitive filesystem do the rebase then move it back?
I understand that git-svn isn't ready for real world work on Windows but I'd like to recover from this mess it has created.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当前最佳答案(我不知道最初提出时是否存在):
git config core.ignorecase true
然后重做变基。 它将继续执行,不会出现错误,甚至可以正确处理文件名中的大小写更改。
这不是 git-svn 特有的。 它可以直接发生在“git rebase”中。
我希望这对下一个人有帮助......
Best current answer (I don't know if this existed back when this was originally posed):
git config core.ignorecase true
Then redo the rebase. It will proceed without error -- and will even properly handle the case change in the filename.
This isn't specific to git-svn. It can happen in a straight 'git rebase'.
I hope that helps the next person....
我在使用 Git(单独使用,甚至使用 git-svn)时遇到了类似的问题,在使用不区分大小写的 Mac 文件系统时,对于更改文件名的大小写感到非常困惑。 我没有找到解决方案来修复不区分大小写的文件系统上的存储库,而是在
.dmg
文件中创建了一个新的区分大小写的卷,并将其安装,并在该卷上使用 Git。您可能会发现一些 Git“管道”命令可能会有所帮助。 例如,
git checkout-index
有一个-f
标志来强制覆盖现有文件(也可以在该命令中使用-a
,否则它可能会不做任何事情)。 管道命令通常比瓷器命令更强大(也更危险),但可能为您提供修复此问题所需的灵活性。I ran into a similar problem with Git (alone, not even with git-svn) getting very confused about changing the case of filenames when using a case-insensitive Mac filesystem. I didn't find a solution to fix the repository on the case-insensitive filesystem, but instead created a new case-sensitive volume in a
.dmg
file, mounted that, and used Git on that volume instead.You may find that some of the Git "plumbing" commands might be helpful. For example,
git checkout-index
has a-f
flag to force overwriting of existing files (also use-a
with that command otherwise it might not do anything). The plumbing commands are generally more powerful (and more dangerous) than the porcelain commands, but may give you the flexibility you need to fix this.与在 Windows 下解决此问题的方法相同。 您必须重命名其中一个文件,然后才能恢复另一个文件。
The same way you always solve this problem under Windows. You have to rename one of the files, then you can restore the other one.