git 遇到的问题

1、error: RPC failed; curl transfer closed with outstanding read data remaining

解决办法:

git clone https://username@bitbucket.org/repositoryName.git --depth 1

 

说明:  针对的是有submodule情况,而且--depth=1 表示只下载最近一次的版本,使用浅复制可以大大减少下载的数据量 

2、Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied

解决办法:

sudo chmod -R g+w .git

 

说明: mac环境

 

3、清空npm缓存

sudo npm cache verify clean

 

说明:方便下次npm安装依赖

 

4、解决:Gitlab 的 Permission denied (publickey) 错误

在 .ssh 文件夹目录下config加上

Host gitlab.com
User git
Hostname gitlab.com
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes

说明: mac的~/.ssh目录下

 

5、Getting permission denied errors when i try to install this module globally with SUDO
解决:

sudo npm install --unsafe-perm=true --allow-root

说明:加权限安装

 

6、Error: spawn ../node_modules/optipng-bin/vendor/optipng ENOENT

解决:

sudo npm rebuild

说明:安装的npm有时需要rebuild一下才正常

 

7、FIX warning: ignoring broken ref refs/remotes/origin/HEAD

解决:

1、rm .git/refs/remotes/origin/HEAD

2、git fetch --all

3、git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done

【拉取所有远程所有分支】

说明:删掉错误的HEAD,拉取最新的远程分支

 8、Git push error: Unable to unlink old (Permission denied)

解决:

sudo chmod -R ug+w .;

说明:给对应的文件夹加上可以修改的权限

 

9、Error: Remote HEAD refers to nonexistent ref, unable to checkout

解决:

git branch -a

git checkout new-master

说明:分支指向不明确,那就明确指向 

 

转载于:https://www.cnblogs.com/wuyongyu/p/8269398.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值