How to remove remote origin/refs/heads/master

时间秒杀一切 提交于 2019-11-30 01:54:16

That's not actually a branch on the remote - it's just a local ref that claims to be representing something on the remote, just as origin/master represents the master branch on the remote. The full name of the ref is refs/remotes/origin/refs/heads/master. All you have to do to delete it is:

git branch -r -d origin/refs/heads/master

It's vaguely possible that you managed to push this as well (but you'd have had to try extra hard to do so). If you did, I'd simply listing the refs of origin:

git ls-remote origin

and then, if there's anything stupid there, using git push origin :<refname> to get rid of it.

P.S. If this doesn't do it for you, you're going to want to use git for-each-ref to see all of your refs, and possibly git ls-remote origin to see all the remote ones, and track down exactly which things don't belong, with their fully qualified refnames.

The solution was to delete the branch refs/heads/refs/heads/master

git push origin :refs/heads/refs/heads/master
jecky dalal

It's

git branch -r -d origin/ref/heads/master

instead of

git branch -r -d origin/refs/heads/master 

in the code part to delete branch. There is difference in ref word in the code.

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