Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a git branch named "--track"

I made a mistake when I checked out a new branch with git. git version 1.7.1

I ran git branch -b --track origin/develop and I got a branch named --track. How can I delete it?

What I have done:

$ git branch
--track
* develop
master

$ git branch -d --track
$ git branch -d "--track"
$ git branch -D --track
$ git branch -D "--track"
$ git branch -D '--track'
$ git branch
--track
* develop
master
like image 286
BigKuCha Avatar asked Jan 30 '23 01:01

BigKuCha


1 Answers

Rather than trying to figure out (if there is) a way to get the git tools to do it, you can simply

rm .git/refs/heads/--track
like image 196
hobbs Avatar answered Feb 05 '23 15:02

hobbs