What you have done here is create an ordinary local branch named origin/feature1
. Git is perfectly happy with this—internally, its name is refs/heads/origin/feature1
which clearly marks it as an ordinary local branch—even though it's terribly confusing to users, who see it as looking like a remote-tracking branch.
As Rob already answered, you can simply delete the local branch with the bogus name. Alternatively, you can rename it, which avoids having to get off it first:
$ git branch
master
* origin/feature1
$ git branch -m feature1
$ git branch
master
* feature1
Note that actual remote branches have full internal names that start with refs/remotes/
, and you can run git symbolic-ref HEAD
to see the full internal name of the current branch (which may be less confusing, provided you know about the refs/heads/
vs refs/remotes/
thing).