Git 命令记录

2020-12-07  本文已影响0人  RulerMike
git rm -rf --cache directory/file  指定文件夹/文件跟踪关系清除

git clone 由于网络或其他原因中断:
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
通常由于项目由于时代久远,所以导致整个项目比较复杂庞大。出现这种错误,就是因为curl 的 postBuffer 默认值太小的原因,重新在终端配置一下这个值就可以了:

git config --global http.postBuffer 524288000
(git clone http://github.com/large-repository --depth 1
cd large-repository
git fetch --unshallow)

git 重置本地账号密码

git config --system --unset credential.helper

gitignore 没有生效

如果某些文件已经被纳入了版本管理中,就算是在.gitignore中已经声明了忽略路径也是不起作用的,这时候我们就应该先把本地缓存删除,然后再进行git的push,这样就不会出现忽略的文件了。git清除本地缓存命令如下:

git rm -r --cached .  
git add .
git commit -m "update gitignore"

git 设置账号

这里的邮箱 gdutxiaoxu@163.com 替换成自己的邮箱
ssh-keygen -t rsa -C "gdutxiaoxu@163.com"

git 错误: SSL_read: Connection was reset, errno 10054

git config --global http.sslVerify "false"

上一篇 下一篇

猜你喜欢

热点阅读