0

So I have a newly created repo and I attempted to commit my newly created code but I got an error. So I ran 'git fsck' on my repo and I got this error.

broken link from    tree 9da8f3ce1355d9bdf03734d42ab15e50e5cf6361
              to    tree 64a40fc17140c1ce37720675d327d59aa9105ef1
missing tree 64a40fc17140c1ce37720675d327d59aa9105ef1

I am new to git, so I was wondering what can I do to fix this error?

Thanks!

I looked at : Git Missing Commit error and I didn't understand it.

Community
  • 1
  • 1
t p
  • 71
  • 1
  • 6
  • which error did you get when you committed? and HOW did you commit? – eckes Mar 13 '12 at 10:31
  • You can try `git reflog | grep 64a40f` to see if it's still in the reflog. That might provide some more information, but as @eckes says, it depends on what error you got. – Brandan Mar 14 '12 at 03:22

3 Answers3

1

That error means that somehow or other, one of the object files that Git uses to store the contents of your repository history has gotten lost/corrupted.

If you just recently created the repo, I'd suggest just re-creating it (or re-cloning if you cloned it from somewhere).

Amber
  • 507,862
  • 82
  • 626
  • 550
0

Use git add . instead of git add -A. It worked for me.

0

Try running git gc, and then push your changes.

Referral Link: https://git-scm.com/docs/git-gc

Grant Miller
  • 27,532
  • 16
  • 147
  • 165