Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push was rejected due to missing or corrupt local objects git-lfs

I am new to git-lfs, Following are the steps I configured and tried to push git-lfs

git clone [email protected]:group/project.git copied a tar.gz lfs file from different repo to my current repo, then

git lfs install                      
git lfs track "*.tar.gz"
git add .gitattributes
git commit -m "message"

while git push origin master:

Error I am facing:

(missing) code.tar.gz (f2b4bf22bcb011fef16f80532247665d15edbb9051***)
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s, done.
hint: Your push was rejected due to missing or corrupt local objects.
hint: You can disable this check with: 'git config lfs.allowincompletepush true'
error: failed to push some refs to '[email protected]:group/project.git'

For your reference: when I run ls .git/lfs/objects/f2/b4 I'm not able to find anything inside.

but for other tar files if I run ls .git/lfs/objects/g3/8a i am able to see c5a9a2e024875718b6377bb15a42fac872a3**** value

like image 869
k4jc Avatar asked Oct 12 '20 11:10

k4jc


1 Answers

I solved it by downloading the lfs objects referenced from that specific branch:

git lfs fetch --all <remote-name> <branch-name>

it will populate the missing files .git/lfs/objects folder

like image 192
Assaf Shouval Avatar answered Nov 03 '22 01:11

Assaf Shouval