1

When I run the git branch command there is a branch listed with (1) appended to it, I never created a branch with that name and I can't delete it using the git branch -d command. What is it, and how do I delete it? Thanks for your help :)

enter image description here

EDIT

Using accepted answer: enter image description here

mbigras
  • 7,664
  • 11
  • 50
  • 111
  • Did this git repo live on a Dropbox or something like that? That'd explain where the `(1)` came from. – hobbs May 25 '16 at 08:41
  • Whatever you do, [avoid parentheses in branch names](http://stackoverflow.com/questions/32355540/complex-git-branch-name-broke-all-git-commands). – jub0bs May 25 '16 at 08:44

1 Answers1

2

Its invalid to have that space as part of a branch name, so not clear how it got created, if its actually a real branch.

You can go low level to delete branches by directly manipulating the .git dir. Verify that it's under .git/refs/heads and then remove the file .git/refs/heads/gps-feature-branch* under there. Perhaps this is how the branch name was manipulated like this in the first place (although git wouldn't recognize the space in a branch name, you can add parens here).

David Neiss
  • 8,161
  • 2
  • 20
  • 21