git & go get

git

  1. 错误 01: git pull
error: cannot lock ref 'refs/remotes/origin/bugfix/remove_unused_log': 'refs/remotes/origin/bugfix' exists; cannot create 'refs/remotes/origin/bugfix/remove_unused_log'
From [gitlab.xxxx.com](http://gitlab.xxxx.com/):backend/live-campaign
! [new branch]        bugfix/remove_unused_log -> origin/bugfix/remove_unused_log  (unable to update local ref)
87b5ad5c..4afbf8fe  testing/1228             -> origin/testing/1228

删掉远程分支 testing/1228, 本地执行 git fetch --prune

  1. 错误 02: go get xxxx
go: [gitlab.xxxxx.com/backend/live-medal/_proto@v1.0.51-0.20210616102043-111161cafa36:](http://gitlab.xxxxx.com/backend/live-medal/_proto@v1.0.51-0.20210616102043-111161cafa36:) invalid pseudo-version: git fetch -f [https://gitlab.xxxxx.com/backend/live-medal.git](https://gitlab.xxxxx.com/backend/live-medal.git) refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/lixingliang/go/pkg/mod/cache/vcs/2c2ff527fe76e1bac601f29f1308f5a6d70182f2daee5d408b90e6d0de343a2e: exit status 1:
From [gitlab.p1staff.com](http://gitlab.xxxxx.com/):backend/live-medal
* [new branch]        bugfix/hier    -> bugfix/hier
* [new branch]        bugfix/remove  -> bugfix/remove
error: cannot lock ref 'refs/heads/testing/210608': 'refs/heads/testing' exists; cannot create 'refs/heads/testing/210608'
! [new branch]        testing/210608 -> testing/210608  (unable to update local ref)
error: some local refs could not be updated; try running
'git remote prune [https://gitlab.xxxxx.com/backend/live-medal.git](https://gitlab.xxxxx.com/backend/live-medal.git)' to remove any old, conflicting branches

解决: rm -rf $GOPATH/pkg/mod/gitlab.xxxxx.com/backend/live-medal, 然后重新 go get ./...

再不行: rm -rf $GOPATH/pkg/mod/cache/vcs/, 然后重新 执行 go get ./...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值