我正在尝试将代码推送到远程仓库 -
git push uat release/1.1:release
Counting objects: 4047, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1679/1679), done.
Writing objects: 100% (4047/4047), 3.38 MiB | 1.79 MiB/s, done.
Total 4047 (delta 2160), reused 3666 (delta 1909)
remote: Switched to branch 'release'
To ubuntu@ubuntu-jvm:/repos/tms/uat
* [new branch] release/1.1 -> release
error: there are still refs under 'refs/remotes/uat/release'
error: Cannot lock the ref 'refs/remotes/uat/release'.
如何解决上述错误。
答案 0 :(得分:6)
我怀疑您的release/<something>
遥控器上有其他名为uat
的分支。您正在运行的push
命令正在尝试将本地分支release/1.1
转换为远程分支release
,但远程拒绝删除release/<something>
,因为这会丢失信息。尝试git push uat release/1.1:newrelease
或类似的东西,以避免尝试让一个分支与包含其他分支的“子目录”相同的分支(它不是真正的子目录,但git
内部工作的方式,它有时存储为一个实际的子目录。)
git remote show uat
或git branch -r
会向您显示uat
遥控器的分支。