Home > database >  Git status hangs after rsync-ing local git lfs repo to new disk
Git status hangs after rsync-ing local git lfs repo to new disk

Time:10-10

I have a git repo of size ~450GB (configured with Git LFS). Due to lack of space on my original drive, I copied the repo to a new disk using rsync (rsync -a src dst). The copy completed successfully but now git commands like git status take forever/hang (10 mins).

git status works perfectly fine on the repo that's still on the original disk. Based on this answer, I tried git fsck and the output is identical to the output of git fsck on the original repo.

Any ideas why git status is taking so long on the new drive? I tested the drive speed and it should be just as fast as the old drive. Does git need to reindex the whole (giant) repo after it moved locations (even though the folder structure is intact)?

CodePudding user response:

Does git need to reindex the whole (giant) repo after it moved locations (even though the folder structure is intact)?

Yes. The index holds cache data about each file (hence the third name for the index, "cache", in addition to the second name, "staging area"). This cache data is OS-specific, and includes information that will generally change if a file is copied.

Once the index is updated, however, things should go back to normal. So this should be a one-time deal.

  • Related