{"thread":{"id":"26145","subject":"Unable to delete remote branch with a strange name","startedAt":"2010-12-28T07:06:10Z","lastAt":"2010-12-28T17:59:29Z","messageCount":4,"participants":["Jingzhao Ou","Andreas Schwab","Tomas Carnecky"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158631","messageId":"loom.20101228T080344-503@post.gmane.org","threadId":"26145","inReplyTo":null,"subject":"Unable to delete remote branch with a strange name","fromName":"Jingzhao Ou","fromEmail":"jingzhao.ou@gmail.com","sentAt":"2010-12-28T07:06:10Z","receivedAt":"2010-12-28T07:06:10Z","isPatch":false,"sender":{"key":"jingzhao.ou@gmail.com","avatar":null},"body":"Hi, all,\n\nWhen I checked out a git repository, it has the following remote branches:\n\n$ git br -r\n origin/HEAD -> origin/master\n origin/master\n origin/dev/main\n origin/remotes/origin/dev/main\n\nI tried to delete the last branch with a strange long name. Using \"git push\" to \ndelete it would fail.\n\n$ git push origin :remotes/origin/dev/main\nPushing to jou@xx.xx.xx.xx:gsfw/omu_fw\nerror: dst refspec remotes/origin/dev/main matches more than one.\nerror: failed to push some refs to 'jou@xx.xx.xx.xx:gsfw/omu_fw'\n\nHowever, I can create a new branch from it:\n\n$ git co -b jou.temp origin/remotes/origin/dev/main\nBranch jou.temp3 set up to track remote branch remotes/origin/dev/main\nfrom origin.\nSwitched to a new branch 'jou.temp3'\n\nBut again, I cannot push any changes in \"jou.temp3\" branch to that weird branch:\n\n$ git push origin HEAD:remotes/origin/dev/main\nerror: dst refspec remotes/origin/dev/main matches more than one.\nerror: failed to push some refs to 'jou@xx.xx.xx.xx:gsfw/omu_fw'\n\nI guess somehow, git is confused by \"origin/dev/main\" and \n\"origin/remotes/origin/dev/main\". Especially, it cannot identify the latter\nproperly.\n\nI wonder if any one can give me some suggestions on how to deal with this \nsituation.\n\nThanks a lot!\nJingzhao\n"},{"id":"158632","messageId":"m2hbdy9top.fsf@whitebox.home","threadId":"26145","inReplyTo":"loom.20101228T080344-503@post.gmane.org","subject":"Re: Unable to delete remote branch with a strange name","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-12-28T08:40:22Z","receivedAt":"2010-12-28T08:40:22Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Jingzhao Ou <jingzhao.ou@gmail.com> writes:\n\n> I guess somehow, git is confused by \"origin/dev/main\" and \n> \"origin/remotes/origin/dev/main\". Especially, it cannot identify the latter\n> properly.\n\nTry fully qualifying the remote branch (beginning with refs/heads/).\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"158672","messageId":"loom.20101228T170808-756@post.gmane.org","threadId":"26145","inReplyTo":"m2hbdy9top.fsf@whitebox.home","subject":"Re: Unable to delete remote branch with a strange name","fromName":"Jingzhao Ou","fromEmail":"jingzhao.ou@gmail.com","sentAt":"2010-12-28T16:10:14Z","receivedAt":"2010-12-28T16:10:14Z","isPatch":false,"sender":{"key":"jingzhao.ou@gmail.com","avatar":null},"body":"Andreas Schwab <schwab <at> linux-m68k.org> writes:\n> \n> Jingzhao Ou <jingzhao.ou <at> gmail.com> writes:\n> \n> > I guess somehow, git is confused by \"origin/dev/main\" and \n> > \"origin/remotes/origin/dev/main\". Especially, it cannot identify the latter\n> > properly.\n> \n> Try fully qualifying the remote branch (beginning with refs/heads/).\n> \n> Andreas.\n> \n\nHi, Andreas,\n\nYes, using the absolute path works like a champ! \n\ngit push origin :refs/heads/remotes/origin/dev/main\n\nThanks a lot for your help!\n\nJingzhao\n"},{"id":"158679","messageId":"4D1A2581.9050305@dbservice.com","threadId":"26145","inReplyTo":"loom.20101228T170808-756@post.gmane.org","subject":"Re: Unable to delete remote branch with a strange name","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2010-12-28T17:59:29Z","receivedAt":"2010-12-28T17:59:29Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"  On 12/28/10 5:10 PM, Jingzhao Ou wrote:\n> Yes, using the absolute path works like a champ!\n>\n> git push origin :refs/heads/remotes/origin/dev/main\n\nDo not use the term 'path' in this context. The fact that a ref looks \nlike a path, and can be stored on the filesystem under the same \ndirectory structure is just an implementation detail. Note the *can*, \nbecause in the case of packed refs (see man git-pack-refs) the term \n'path' is not even remotely accurate.\n\nWe use the term 'fully qualified ref' (see the similarity with 'fully \nqualified domain name') if we want to stress out that the full name of \nthe ref is used (refs/heads/foo) instead of an abbreviation (foo).\n\ntom\n"}]}