0

I navigate to a directory i want to make a new git repository in. I run the following code:

git init
touch readme
git add --all
git commit -m "test commit"

and i get the following error:

error: unable to find e80ad49ace82167de62e498622d70377d913c79e
fatal: e80ad49ace82167de62e498622d70377d913c79e is not a valid object

Anyone have any ideas? Everything in the .git folder seems to be correct. It has a HEAD file.

Peter
  • 11
  • 5
  • Unless I'm mistaken, if you're creating a brand new Git repository, it shouldn't have a HEAD file since you've no commits yet. Perhaps try deleting the `.git` folder a try again? – miqh Jul 11 '14 at 00:36
  • When i just run git init, a HEAD file is created by default. I have tried this about a dozen times already. Disbelieving that such a simple thing would not work... – Peter Jul 11 '14 at 00:51
  • @miqid I can confirm that a HEAD file is created regardless of # of commits. However, I cannot reproduce the OP's issue (I just ran the same exact 4 commands you posted, and everything went through fine). – Mike Koch Jul 11 '14 at 01:06
  • Ah, disregard my comment, I meant to say that the file HEAD references under `.git/refs/heads` (i.e. master) shouldn't get created until you commit. – miqh Jul 11 '14 at 01:29

0 Answers0