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文件夹,重新拉项目吧

相关内容

热门资讯

从哈尔滨到长白山闺蜜5天4晚天... 从哈尔滨到长白山闺蜜5天4晚天池+延吉边境:拍照打卡真实体验 一、出发前的纠结:比老板还难搞的攻略,...
搭上低空经济、AI文旅?两连板... 来源:e公司 桂林旅游(000978)回应市场热点。 9月8日,桂林旅游再度涨停,斩获2连板。当天晚...
八达岭长城国庆怎么去最省心?坐... 八达岭长城是来北京必去的景点之一,尤其是第一次来北京的游客。但国庆期间去八达岭,最大的挑战不是爬长城...
秋日睦邻游园会热闹开锣!居民重... (来源:上观新闻) 近日,殷行街道包头路社区睦邻活动室里,举办了一场秋日睦邻趣味游园会,辖区居民、户...
带父母去长白山怎么玩?3天2晚... 带父母去长白山怎么玩?3天2晚天池攻略,有些坑帮你们踩过了 一句话总结:这次带父母去长白山,我选了黑...