git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Unable to delete remote branch with a strange name

From
JOJingzhao Ou <jingzhao.ou@gmail.com>
Date
Dec 28, 2010, 07:06 UTC
Message-ID
<loom.20101228T080344-503@post.gmane.org>
Hi, all,
When I checked out a git repository, it has the following remote branches:
$ git br -r
 origin/HEAD -> origin/master
 origin/master
 origin/dev/main
 origin/remotes/origin/dev/main

I tried to delete the last branch with a strange long name. Using "git push" to delete it would fail.

$ git push origin :remotes/origin/dev/main Pushing to jou@xx.xx.xx.xx:gsfw/omu_fw error: dst refspec remotes/origin/dev/main matches more than one. error: failed to push some refs to 'jou@xx.xx.xx.xx:gsfw/omu_fw'

However, I can create a new branch from it:

$ git co -b jou.temp origin/remotes/origin/dev/main Branch jou.temp3 set up to track remote branch remotes/origin/dev/main from origin. Switched to a new branch 'jou.temp3'

But again, I cannot push any changes in "jou.temp3" branch to that weird branch:

$ git push origin HEAD:remotes/origin/dev/main error: dst refspec remotes/origin/dev/main matches more than one. error: failed to push some refs to 'jou@xx.xx.xx.xx:gsfw/omu_fw'

I guess somehow, git is confused by "origin/dev/main" and "origin/remotes/origin/dev/main". Especially, it cannot identify the latter properly.

I wonder if any one can give me some suggestions on how to deal with this situation.

Thanks a lot! Jingzhao

Next: Andreas Schwab
Message 1 of 4 in “Unable to delete remote branch with a strange name”
  1. Jingzhao OuDec 28, 2010
  2. Andreas SchwabDec 28, 2010
  3. Jingzhao OuDec 28, 2010
  4. Tomas CarneckyDec 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.