网上找到两个办法:1. git pull 再更新项目 2.git fetch。然而,两者都不管用。以下是git fetch提示的报错信息。
error: cannot lock ref 'refs/remotes/origin/feature/lychee-wechat-commandation/commandation': 'refs/remotes/origin/feature/lychee-wechat-commandation' exists; cannot create 'refs/remotes/origin/feature/lychee-wechat-commandation/commandation'From http://gitlab.cloud.szunicom.com/wechatwork/lychee ! [new branch] feature/lychee-wechat-commandation/commandation -> origin/feature/lychee-wechat-commandation/commandation (unable to update local ref)error: some local refs could not be updated; try running 'git remote prune origin' to remove any old, conflicting branches
其实,git fetch已经达到更新的目的,只是我的新老分支的命名是 a 和 a/b 这种类型,导致更新出现冲突。
提示已说明:使用命令git remote prune origin,可以刷新本地仓库,与远程仓库的改动保持一致。等待同步后,可以发现分支已更新。