我正在尝试将远程仓库与本地仓库同步,但会出现以下错误。一些文件(没有扩展)没有与WINDOWS机器上的本地存储同步,但我可以在MAC机器上成功同步。
WINDOWS中是否有任何配置设置来处理这种情况?
错误细节
git.exe clone --progress -v "https://github.com/xxxx/xxxxx.git" "C:\Data\GitHub\simility\vishesh-common"
Cloning into 'C:\Data\GitHub\simility\vishesh-common'...
POST git-upload-pack (200 bytes)
remote: Counting objects: 3912, done.
remote: Compressing objects: 100% (487/487), done.
Receiving objects: 100% (3912/3912), 2.70 MiB | 567.00 KiB/s, done.
Resolving deltas: 100% (1578/1578), done.
remote: Total 3912 (delta 409), reused 0 (delta 0)
Checking connectivity... error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030050305_fantasy-trilogy-spin?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030295038_laser-dogs?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_arizona-native-bird-painting-series?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_native-birds-ii?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard-0?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_only-you-can-prevent-computercide?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_vector-cupholder-protect-your-laptop-and-your-lap?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_103055429_death-of-an-angel?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030650665_rachel-vanslyke-making-a-new-record-together-we-ca?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030835091_russian-trucks-of-world-war-two?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-expansion-next-level?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-project-expansion?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099860912_yaw-clock?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099992656_heavenly-sight-a-vision-out-of-blindness?ref=users (Invalid argument)
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD'
git did not exit cleanly (exit code 128) (21746 ms @ 29-09-2014 13:32:13)
答案 0 :(得分:34)
我遇到了同样的问题,但是不愿意重命名或删除这些文件。所以这里有一个解决方法,以防你在没有使用稀疏结账访问这些文件的情况下生活:
转到您的仓库中的.git
文件夹,然后打开文件config
。 (你也可以使用tortoise-git编辑你的配置,但我还没有在这里安装它。)在[core]
部分添加行
sparsecheckout = true
然后转到文件夹.git/info
并创建文件sparse-checkout
。添加类似
*
!kickstarter/parsers/data/kickstarter/campaigndetails/*
第一行包含所有内容,而第二行则排除kickstarter/parsers/data/kickstarter/campaigndetails/
中的所有文件。你现在应该可以结帐回购。使用通配符你可以做更复杂的排除。
答案 1 :(得分:20)
如果我很好地阅读了该日志,那些文件的名称将以“?ref = users”
结尾Windows不允许你拥有'?'在文件名中,就像它不允许有“\”或“*”一样。在Linux下,如果你逃避这些角色,它是可能的。在Windows上,我认为根本不可能。见http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247
你将很难有这样的名字..我实际上无法提出任何可以让你同步1:1的想法。您当然可以获取它们并将它们保存在一些安全的名称下,例如_projects_1099992656_heavenly-sight-a-vision-out-of-blindness__ref=users
,但我不知道如何自动执行此操作,或者如何稍后通知Git关于该映射,抱歉..
这些文件名看起来像是带有后缀的HTML查询参数。真的需要吗?也许这只是一些可以删除的工件?尝试与项目的mantainer交谈,也许他们可以简单地删除那个奇怪的后缀?
答案 2 :(得分:3)
我使用的是bitbucket,它具有删除问题文件的功能。
这就是我的工作。