Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git -cant pull or commit

I have a problem committing, and pulling: In the commit IDE I see:

warning not all local changes may be shown due to an error: unable to read tree 

and only part of my files commits is there, also I cant see diff with the last versions.

when I try to pull/fetch:

error: refs/remotes/origin/project-1 does not point to a valid object!
error: refs/remotes/origin/project-2 does not point to a valid object!
....

and so on

in the end, the error is

fatal: pack has 268 unresolved deltas

Is there any way for me to fix it without cloning again?

like image 280
Bbar Avatar asked Oct 15 '25 13:10

Bbar


1 Answers

ok, I fixed it by using

mv -v .git .git_old &&            # remove old git
git init &&                       # initialise new repo
git remote add origin "${url}" && # link to old repo
git fetch &&                      # get old history
git reset origin/master --mixed   # force update to old history

it's from this stack question How to fix corrupted git repository?

like image 175
Bbar Avatar answered Oct 18 '25 03:10

Bbar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!