git 推送到远程仓库给出了错误 - 下仍有参考

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11245897/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:08:49  来源:igfitidea点击:

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

git

提问by murtaza52

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.

如何解决上述错误。

采纳答案by twalberg

I suspect you have other branches named release/<something>on your uatremote. The pushcommand you are running is trying to convert a local branch release/1.1into a remote branch release, but the remote refuses to remove release/<something>because that would lose information. Try git push uat release/1.1:newreleaseor 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 gitworks internally, it is sometimes stored as an actual subdirectory).

我怀疑您release/<something>uat遥控器上还有其他分支。push您正在运行的命令正在尝试将本地分支release/1.1转换为远程分支release,但远程拒绝删除,release/<something>因为这会丢失信息。尝试git push uat release/1.1:newrelease或类似的方法以避免尝试将单个分支命名为与包含其他分支的“子目录”相同的内容的冲突(它不是真正的子目录,但git内部工作的方式,它有时存储为实际的子目录)。

git remote show uator git branch -rwill show you what branches your uatremote has.

git remote show uat或者git branch -r会告诉你你的uat遥控器有哪些分支。