Git clone failed while unpacking - lack of space - how to recover without full cloning?

I cloned a repo with git yesterday and ended up free space on my virtual hard drive. Since then I have moved the repo and have had enough space. git clone ran out of space while unpacking loaded objects. The fact is that git thinks it has been updated, but git status lists the pages of deleted files.

Git pull does not work, because it thinks about it up to date. What should I do, I do not need to clone the entire repository again?

+6
source share
2 answers

Try:

 git reset --hard HEAD 

This should update your working copy.

+6
source

To modify Sry, I misunderstood and thought that the object database might be damaged / incomplete.


not. However, if you insist that you can find somewhere with git fsck or if you really desperately need bandwidth: rsync

 rsync -hxPavilyzH --delete user@remote :/repo/origin/.git/ brokenclone/.git/ 

To find out what acceleration / throughput optimizations you can expect:

 rsync -hxPavilyzH --delete user@remote :/repo/origin/.git/ brokenclone/.git/ -n --stats 
0
source

Source: https://habr.com/ru/post/891767/


All Articles