Laura
Laura

Reputation: 163

Git: Reference has invalid format: 'refs/heads/SomeBranch'

I am new to git and now the following error occurs:

fatal: Reference has invalid format: 'refs/heads/SomeBranch' (Conflict through use of capital and small initial letters) Unexpected end of command stream

SomeBranch (capitalized!) was actually deleted earlier (local and on remote) and I am working on a local branch someBranch (not capitalized!). Then, I git add my local changes and git commit -m "Some changes" -a. The error occured while git push and also when git push -u origin someBranch. someBranch is not yet in the repo.

Upvotes: 1

Views: 218

Answers (1)

Michael Durrant
Michael Durrant

Reputation: 96454

Make a backup of the entire project (just in case) and then do

awk '!/Conflict/' .git/packed-refs > tmp && mv tmp .git/packed-refs

Upvotes: 1

Related Questions