GIT使用踩坑!!!我的妈妈呀,烦死了烦死了烦死了!!!
admin
2024-01-28 02:45:27

问题1:Git:RPC failed;curl 56 OpenSSL SSL_read:Connection was reset,errno 10054

原因:
文件太大,上传失败
方法:

初始化:git init
关闭远程:git config --global core.compression 0
重新克隆:git clone url地址
增大流量:git fetch --depth=2147483647
提交代码:git pull --all

原答案:
First, turn off compression:

git config --global core.compression 0

Next, let’s do a partial clone to truncate the amount of info coming down:

git clone --depth 1

When that works, go into the new directory and retrieve the rest of the clone:

git fetch --unshallow

or, alternately,

git fetch --depth=2147483647

Now, do a regular pull:

git pull --all

I think there is a glitch with msysgit in the 1.8.x versions that exacerbates these symptoms, so another option is to try with an earlier version of git (<= 1.8.3, I think).

问题2:git:fatal:Unable to create"…/.git/index.lock

原因:
报错大致意思就是创建index.lock文件失败,因为已经存在index.lock文件了
方法:

命令删除:rm -rf .../.git/index.lock
电脑直接搜索删除前提是必须先关闭GIT,否则不能直接删除index.lock作用:在进行某些比较费时的git操作时自动生成,操作结束后自动删除,相当于一个锁定文件,目的在于防止对一个目录同时进行多个操作。有时强制关闭进行中的git操作,这个文件没有被自动删除,之后你就无法进行其他操作,必须手动删除。

问题3:提示warning: There are too many unreachable loose objects; run ‘git prune’ to remove them.

原因:
因为提交的改动过多,导致本地的缓冲区占用太大

方法

瘦身优化本地项目:git gc  --prune=now 

问题4:git 错误 Reinitialized existing Git repository

原因
没有原因,我也不知道原因,妈的!直接删除项目下的.git文件夹,重新拉项目吧

相关内容

热门资讯

三天两夜,在广州该怎么吃? 城市特色美食一定要试 最近,有市民察觉,广州不少好吃的餐厅、酒楼、美食街以及地铁线路突然...
原创 4... 夏天燥热缺水,很容易大便干结、肚子胀,这4道清淡吃法高纤补水,温和促肠道蠕动,便便顺畅,肠胃无负担。...
原创 南... 标题:南方年夜饭上的4种海鲜食品,虾蟹很常见,唯有它让人念念不忘! 在南方的年夜饭上,海鲜总是不可...
原创 花... 当乳白的花菜与绯红的番茄在锅中相遇,仿佛上演着一场味蕾的芭蕾。这道看似平常的家常菜,实则蕴藏着中国饮...
原创 别... 别小看葛根,懂的人都在喝,日常这样吃益处多,做法简单又实用 葛根是药食同源的好食材,性质平和,日常合...