{"thread":{"id":"25588","subject":"Unable to remove git branch","startedAt":"2010-10-29T07:43:12Z","lastAt":"2010-10-29T08:42:45Z","messageCount":5,"participants":["Sascha Peilicke","Mathias Lafeldt","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"154764","messageId":"201010290943.13177.sasch.pe@gmx.de","threadId":"25588","inReplyTo":null,"subject":"Unable to remove git branch","fromName":"Sascha Peilicke","fromEmail":"sasch.pe@gmx.de","sentAt":"2010-10-29T07:43:12Z","receivedAt":"2010-10-29T07:43:12Z","isPatch":false,"sender":{"key":"sasch.pe@gmx.de","avatar":null},"body":"Hi guys,\n\nI accidentally did an 'git co -b --track origin/foo' ending up with a local \nbranch '--track'. Sadly, git is unable to remove or rename that branch because \nit always interprets it as a parameter. \n\nAs a consequence, 'git br -d \"--track\"' does nothing and 'git br -m \"--track\" \nfoo' even renames the current branch, say, master,  to 'foo'. Any hints on how \nto get rid of that pesky branch?\n\nBTW please CC me as I'm not subscribed to this list.\n-- \nMit freundlichen Grüßen,\nSascha Peilicke\nhttp://saschpe.wordpress.com\n"},{"id":"154765","messageId":"4CCA7DA8.3020607@debugon.org","threadId":"25588","inReplyTo":"201010290943.13177.sasch.pe@gmx.de","subject":"Re: Unable to remove git branch","fromName":"Mathias Lafeldt","fromEmail":"misfire@debugon.org","sentAt":"2010-10-29T07:54:16Z","receivedAt":"2010-10-29T07:54:16Z","isPatch":false,"sender":{"key":"misfire@debugon.org","avatar":"https://avatars.githubusercontent.com/u/158074?v=4"},"body":"Sascha Peilicke wrote:\n> Hi guys,\n> \n> I accidentally did an 'git co -b --track origin/foo' ending up with a local \n> branch '--track'. Sadly, git is unable to remove or rename that branch because \n> it always interprets it as a parameter. \n> \n> As a consequence, 'git br -d \"--track\"' does nothing and 'git br -m \"--track\" \n> foo' even renames the current branch, say, master,  to 'foo'. Any hints on how \n> to get rid of that pesky branch?\n> \n> BTW please CC me as I'm not subscribed to this list.\n\nTry:\n\n$ git br -D -- --track\n\n-Mathias\n"},{"id":"154766","messageId":"4CCA7E42.7080906@debugon.org","threadId":"25588","inReplyTo":"4CCA7DA8.3020607@debugon.org","subject":"Re: Unable to remove git branch","fromName":"Mathias Lafeldt","fromEmail":"misfire@debugon.org","sentAt":"2010-10-29T07:56:50Z","receivedAt":"2010-10-29T07:56:50Z","isPatch":false,"sender":{"key":"misfire@debugon.org","avatar":"https://avatars.githubusercontent.com/u/158074?v=4"},"body":"Mathias Lafeldt wrote:\n> Sascha Peilicke wrote:\n>> Hi guys,\n>>\n>> I accidentally did an 'git co -b --track origin/foo' ending up with a local \n>> branch '--track'. Sadly, git is unable to remove or rename that branch because \n>> it always interprets it as a parameter. \n>>\n>> As a consequence, 'git br -d \"--track\"' does nothing and 'git br -m \"--track\" \n>> foo' even renames the current branch, say, master,  to 'foo'. Any hints on how \n>> to get rid of that pesky branch?\n>>\n>> BTW please CC me as I'm not subscribed to this list.\n> \n> Try:\n> \n> $ git br -D -- --track\n\nIt really should be:\n\n$ git branch -D -- --track\n\n('br' is an alias of mine)\n\nSorry for the noise.\n\n-Mathias\n"},{"id":"154769","messageId":"201010291031.42305.sasch.pe@gmx.de","threadId":"25588","inReplyTo":"4CCA7E42.7080906@debugon.org","subject":"Re: Unable to remove git branch","fromName":"Sascha Peilicke","fromEmail":"sasch.pe@gmx.de","sentAt":"2010-10-29T08:31:38Z","receivedAt":"2010-10-29T08:31:38Z","isPatch":false,"sender":{"key":"sasch.pe@gmx.de","avatar":null},"body":"On Friday 29 October 2010 09:56:50 you wrote:\n> Mathias Lafeldt wrote:\n> > Sascha Peilicke wrote:\n> >> Hi guys,\n> >> \n> >> I accidentally did an 'git co -b --track origin/foo' ending up with a\n> >> local branch '--track'. Sadly, git is unable to remove or rename that\n> >> branch because it always interprets it as a parameter.\n> >> \n> >> As a consequence, 'git br -d \"--track\"' does nothing and 'git br -m\n> >> \"--track\" foo' even renames the current branch, say, master,  to 'foo'.\n> >> Any hints on how to get rid of that pesky branch?\n> >> \n> >> BTW please CC me as I'm not subscribed to this list.\n> > \n> > Try:\n> > \n> > $ git br -D -- --track\n> \n> It really should be:\n> \n> $ git branch -D -- --track\n\nThanks, that worked. Maybe '-' should not be allowed as the first char in a \nbranch name?\n-- \nMit freundlichen Grüßen,\nSascha Peilicke\nhttp://saschpe.wordpress.com\n"},{"id":"154773","messageId":"20101029084244.GD26290@burratino","threadId":"25588","inReplyTo":"201010291031.42305.sasch.pe@gmx.de","subject":"Re: Unable to remove git branch","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-29T08:42:45Z","receivedAt":"2010-10-29T08:42:45Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Sascha Peilicke wrote:\n\n>                      Maybe '-' should not be allowed as the first char in a \n> branch name?\n\nHeh - see 6348624 (disallow branch names that start with a hyphen,\n2010-09-14).\n"}]}