简体   繁体   English

git-svn fetch给我一个git无法处理的文件名

[英]git-svn fetch gives me a filename that git doesn't handle

Using git svn fetch to do some local work (using git personally), I got a file that will not "reset". 使用git svn fetch进行一些本地工作(个人使用git),我得到了一个不会“重置”的文件。 I see that it's different from similar files in the same directory in that it has a backslash as part of the name: icon@2xios8\\.png . 我发现它与同一目录中的相似文件不同,因为它的名称中包含反斜杠: icon@2xios8\\.png I suppose the backslash doesn't do anything on other platforms but msysgit on Windows 10 complains that it's unable to create the file. 我想反斜杠在其他平台上没有任何作用,但是Windows 10上的msysgit抱怨它无法创建文件。

I can't figure out how to make git ignore this subdirectory and let me continue with unrelated work. 我不知道如何使git忽略此子目录,而让我继续无关的工作。 But I really need to fix it somehow so git can be used. 但是我确实需要以某种方式修复它,以便可以使用git。

You can do this with git-read-tree and sparse checkout ( git-read-tree ). 您可以使用git-read-tree稀疏签出git-read-tree )来做到这一点。

Therefore you call 所以你打电话

git config core.sparsecheckout true

Then create a file .git/info/sparse-checkout (with touch .git/info/sparse-checkout in msysgit bash). 然后创建一个文件.git/info/sparse-checkout (在msysgit bash中touch .git/info/sparse-checkout )。 Edit this file and change its content to: 编辑此文件并将其内容更改为:

/*
!icon@2xios8\\.png

This tells git to look at all files in your working directory ( /* ) but '!icon@2xios8.png' ( !icon@2xios8\\\\.png ). 这告诉git查看工作目录( /* )中的所有文件,但查看'!icon@2xios8.png'!icon@2xios8\\\\.png )。 Notice the escaped backslash here ( \\\\ )! 注意这里的转义反斜杠( \\\\ )!

After you run git read-tree -mu HEAD you should be able to pull your repository by ignoring that specific file. 运行git read-tree -mu HEAD您应该能够通过忽略该特定文件来拉出存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM