git clone 超时(Git报错:error: invalid path)

本文目录
- Git报错:error: invalid path
- Git使用常见问题解决方法
- 为什么现在从github上clone代码超慢
- git clone时报错 提示 early EOF、The remote end hung up unexpectedly 、 index-pack failed等错误信息
- 在另一台Linux服务器上,下载gitlab代码显示连接超时,是怎么回事
- gitlab解决git Clone 出现 Permission denied, please try again
Git报错:error: invalid path
在git clone到本地时遇到报错:
error: invalid path ’src/main/java/com/sankuai/meituan/hive/udf/Aux.java’
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
查了很久,结果是因为 Windows和Linux系统不兼容 导致的 :(
(1)Windows系统上有些文件名是无法创建文件的,比如上图中的aux,还有com1等,这些是系统保留的设备名。所以导致clone失败。
(2)Linux文件名区分大小写,而Windows不区分。而Linux内核里恰好有一些只有大小写不同的文件,在Windows下只能创建其中的一个。这导致了Git工具的错误。
问题无解。。。想要参与Linux的开发,还是要用Linux系统啊 =v=
Git使用常见问题解决方法
在磨侍Ubuntu下使用$ git clone时出现server certificate verification failed. CAfile:/etc/ssl/则脊certs/ca-certificates.crt CRLfile: none
解决方法:在执行$ git clone 之前瞎盯吵,在终端输入:
export GIT_SSL_NO_VERIFY=1
为什么现在从github上clone代码超慢
1. clone最新一个提交
```
$ git clone --depth=1 git@github.com:atom/atom.git
Cloning into ’atom’...
remote: Counting objects: 444, done.
remote: Compressing objects: 100% (359/359), done.
remote: Total 444 (delta 20), reused 264 (delta 8)
Receiving objects: 100% (444/444), 2.25 MiB | 7.00 KiB/s, done.
Resolving deltas: 100% (20/20), done.
Checking connectivity... done.
```
2. 更新获取完整历史版本
```
$ git fetch --unshallow
remote: Counting objects: 98400, done.
remote: Compressing objects: 100% (27919/27919), done.
remote: Total 98159 (delta 68929), reused 97823 (delta 68611)
Receiving objects: 100% (98159/98159), 236.07 MiB | 18.00 KiB/s, done.
Resolving deltas: 100% (68929/68929), completed with 175 local objects.
From github.com:atom/atom
dbe15f7..7cdaaf2 master -》 origin/master
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 0), reused 7 (delta 0)
Unpacking objects: 100% (7/7), done.
* v0.0.1 -》 v0.0.1
* v0.0.2 -》 v0.0.2
...此处省略91行
* v0.92.0 -》 v0.92.0
* v0.93.0 -》 v0.93.0
* v0.94.0 -》 v0.94.0
```
期间也中断过,和直接clone一样,都不支持续传。
下面的事实可以说明我这里速度有多慢:
unshallow后git status一看:
```
$ git st
On branch master
Your branch is behind ’origin/master’ by 3 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working directory clean
```
git clone时报错 提示 early EOF、The remote end hung up unexpectedly 、 index-pack failed等错误信息
Gitlab服务器环境是CentOS7+Gitlab7.2.1,最近发现在开发机上使用git pull更新文件时,会差喊耐报如下错误。
fatal: The remote end hung up unexpectedlyfatal: early EOFfatal: unpack-objects failed
使用git clone重新checkout源也受到影响,长时间checkout不出来,虚春
Google了半天也没找到个好办法,最后还是查错误日志定位到了问题
在/var/log/gitlab/unicorn/unicorn_stderr.log中,发现如下的错渗竖误信息
E, INFO -- : worker=0 read
看来是被Ruby误认为超时中断了。解决办法就是调大unicorn的timeout值。
修改/var/opt/gitlab/gitlab-rails/etc/unicorn.rb,将
# What the timeout for killing busy workers is, in secondstimeout 30
改为
# What the timeout for killing busy workers is, in secondstimeout 60
最后,运行
sudo systemctl restart gitlab-runsvdir.service
重启Gitlab。
之后客户端就可以正常Git pull或者clone了
在另一台Linux服务器上,下载gitlab代码显示连接超时,是怎么回事
Gitlab上拉代码到另外一台linux服务器上,举个例子吧。以git@osc为例,直接在另一台服务器上git clone url即可
gitlab解决git Clone 出现 Permission denied, please try again
1.打开git bash
2.输入 ssh -keygen -C +"邮件"
例如: ssh-keygen -C"123456@qq.com"
3.结果:
4. cd ~/.ssh/
5.cat id_rsa.pub
6.登录 gitlab
7. 设置gitlab sshkey
8.再次clone即可

更多文章:
知名女星孙侨璐于跨年夜,心梗猝死,年仅25岁!一一一写给年轻人?1月2日演员孙侨潞离世,说好的来日方长转眼就是别离
2026年10月15日 10:40
avantage怎么设置为中文(Avantage安装丢失GIT)
2026年10月15日 03:00
activex控件未注册怎么办(登陆视频监控网页时提示activex控件未注册,怎么解决)
2026年10月14日 20:30







