Git File Integrity

Hamza Yerlikaya picture Hamza Yerlikaya · Jun 8, 2009 · Viewed 20.1k times · Source

Recently my main machine i use for development started overheating. I started to get 4 or 5 lockups per day. Everything freezes. All my projects are under version control using git.

I remember watching Linus' talk at Google saying git will ensure that the files are not corrupt. In my situation is it safe to assume that git will warn me if one of the source files gets corrupt.

OS is Mac OS X 10.4 file system is HFS+.

Answer

Esko Luontola picture Esko Luontola · Jun 8, 2009

You can force Git to check the whole repository with git fsck. If a Git repository gets corrupted, you should get a new clone from a non-corrupted repository.

Under normal operation Git should check parts of the repository as they are read, so it might take longer to notice some corruption, but it will be noticed the first time that you try to access the corrupt data.