GIT使用踩坑!!!我的妈妈呀,烦死了烦死了烦死了!!!

问题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 <repo_URI>

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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

做一个有趣的妞儿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值