mbigras
mbigras

Reputation: 8055

Where did this random git branch come from?

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

Upvotes: 1

Views: 778

Answers (1)

David Neiss
David Neiss

Reputation: 8237

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).

Upvotes: 2

Related Questions