Git无法从github签出回购协议 [英] Git can't checkout a repo from github

查看:167
本文介绍了Git无法从github签出回购协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对此很困惑。我是一个狂热的github用户,从来没有遇到过任何问题。但是,在检查我刚刚制作的repo travis-ci / travis-core的分支时,不管是使用https还是ssh,我都会在tortisegit完成下载git repo后但在第一次检查之前遇到此错误。任何可能导致这种情况的事情?感谢您的帮助!

  remote:计数对象:29130,完成。 
remote:压缩对象:100%(16427/16427),完成。
接收对象:100%(29130/29130),8.37 MiB | 265.00 KiB / s,完成。
解决三角洲问题:完成100%(13171/13171)。
remote:总计29130(delta 13171),重用27543(delta 11662)
错误:无法创建文件规格/夹具/ github / api.github.com / orgs / travis-ci?per_page = 100 .json(无效参数)
错误:无法创建文件spec / fixtures / github / api.github.com / users / svenfuchs?per_page = 100.json(无效参数)
致命:无法结帐工作树
警告:克隆成功,但检出失败。
您可以使用'git status'
检查签出的内容,然后使用'git checkout -f HEAD'

重试结帐。

解决方案

文件 travis-ci?per_page = 100.json 不是有效的文件名在Windows上。
您可以看到在回购库中有这样的实际文件,例如 repos?per_page = 9999.json



你也许可以在cygwin上克隆这个repo(这样的文件名可以在cygwin shell中有效),手动删除有问题的文件,或者用过滤分支git filter-branch --subdirectory-filter 然后继续将你的分叉放回github上。

I am really confused with this. I am a avid github user and never have had a problem before. However, when checking out a fork I just made of the repo travis-ci/travis-core, whether using https or ssh, I run into this bug after tortisegit finished downloading the git repo but before checking it out for the first time. Anything that could cause this? Thanks for the help!

remote: Counting objects: 29130, done.
remote: Compressing objects: 100% (16427/16427), done.
Receiving objects: 100% (29130/29130), 8.37 MiB | 265.00 KiB/s, done.
Resolving deltas: 100% (13171/13171), done.
remote: Total 29130 (delta 13171), reused 27543 (delta 11662)
error: unable to create file spec/fixtures/github/api.github.com/orgs/travis-ci?per_page=100.json (Invalid argument)
error: unable to create file spec/fixtures/github/api.github.com/users/svenfuchs?per_page=100.json (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'

解决方案

The file travis-ci?per_page=100.json is not a valid filename on Windows. You can see that there are actual files named like this in the repo, eg repos?per_page=9999.json

You can maybe clone this repo on cygwin (such a filename would be valid in a cygwin shell), remove the offending files, manually or by filtering the branch with git filter-branch --subdirectory-filter and then proceed to put your fork back on github.

这篇关于Git无法从github签出回购协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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