Deleting a badly named git branch

后端 未结 6 967
一生所求
一生所求 2020-11-22 11:53

I know this isn\'t strictly a programming question, but it is related to git. I accidentally have created a branch in git called --track (I got the order of opt

6条回答
  •  無奈伤痛
    2020-11-22 12:09

    The double hyphen didn't work for me on remote with a branch name containing double quotes and ampersands. However wrapping the name quotes and escaping the contained quotes did the job:

    git push origin --delete "123-my-branch-&-some\"quoted-text\""
    

    and locally:

    git branch -D "123-my-branch-&-some\"quoted-text\""
    

提交回复
热议问题