11

Somehow one of my coworkers was able to create a branch ending with a period. I'm not sure how he did it. It's now causing issues when working with his remote.

The bad branch is: 'bugfix_ESP-924-invalid-email-error-message.'

When I do a git fetch taylor it just hangs.

When I list the branches the period is invisible

git branch -r | grep 924
taylor/bugfix_ESP-924-invalid-email-error-message

If I try to delete the branch without the period, I get a 404 (makes sense)

git push origin :taylor/bugfix_ESP-924-invalid-email-error-message
error: unable to delete 'taylor/bugfix_ESP-924-invalid-email-error-message': remote ref does not exist

If I try to delete the true branch name I get a 'invalid branch name'

git push origin :taylor/bugfix_ESP-924-invalid-email-error-message.
fatal: remote part of refspec is not a valid name in :taylor/bugfix_ESP-924-invalid-email-error-message.

Any suggestions?

jwieland
  • 223
  • 1
  • 6

1 Answers1

1

A branch is just a link to a commit. It's stored in .git/refs/heads/branchname. If you can access remote directly, just delete the file. But please make a backup before. Two backups are even better :)

albert
  • 8,112
  • 3
  • 47
  • 63
Nick Volynkin
  • 14,023
  • 6
  • 43
  • 67