push to remote repo gives the error - there are still refs under

匿名 (未验证) 提交于 2019-12-03 03:00:02

问题:

I am trying to push code to a remote repo -

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'. 

How do I resolve the above error.

回答1:

I suspect you have other branches named release/<something> on your uat remote. The push command you are running is trying to convert a local branch release/1.1 into a remote branch release, but the remote refuses to remove release/<something> because that would lose information. Try git push uat release/1.1:newrelease or something similar to avoid the conflict of trying to have a single branch named the same thing as a "subdirectory" containing other branches (it's not truly a subdirectory, but the way git works internally, it is sometimes stored as an actual subdirectory).

git remote show uat or git branch -r will show you what branches your uat remote has.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!