Git - 执行git pull 一直报错 error: cannot lock ref

1.应用场景

主要用于git pull 远程分支代码, 出现报错, 原因以及解决办法.

2.学习/操作

1.文档阅读

https://blog.csdn.net/qq_15437667/article/details/52479792

https://stackoverflow.com/questions/6656619/git-and-nasty-error-cannot-lock-existing-info-refs-fatal

 

2.整理输出

2.1 执行git pull 出现报错

 

From github.com:seekasia/siva
 * [new branch]          Hotfix/sycee-633_my_product_options -> 
origin/Hotfix/sycee-633_my_product_options
error: cannot lock ref 'refs/remotes/origin/SATS-460/fix/remove-bookmark-when-page->-1-not-working': Unable to create 'D:/william/provision/src/siva/.git/refs/remotes/origin/SATS-460/fix/remove-bookmark-when-page->-1-not-working.lock': Invalid argument    
 ! [new branch]          SATS-460/fix/remove-bookmark-when-page->-1-not-working -> origin/SATS-460/fix/remove-bookmark-when-page->-1-not-working  (unable to update local ref)
   bc5e0e51c..540861cf0  hotfix/sycee-633_my_product_options -> 
origin/hotfix/sycee-633_my_product_options

 

原因:

TBD

 

解决办法:

1.强制拉取

执行还是有问题, 没能拉取最新的远程代码

 

2. 删除对应的ref文件

还是不行.

 

最后的解决办法:

git remote prune origin

git pull origin master

推测原因:

某种原因导致 git pull不能拉取远程分支, 需要使用git pull origin master 才行

需要重新设置一遍才行

 

结果还是不行, 还是要执行

git pull origin 分支名  完整命令才可以  /// 具体仍在寻找原因和解决办法中.

 

再不济, 就是重新clone仓库试试

 

 

后续补充

...

3.问题/补充

TBD

4.参考

https://stackoverflow.com/questions/6656619/git-and-nasty-error-cannot-lock-existing-info-refs-fatal

后续补充

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值