what are the different repository format versions (for the core.repositoryFormatVersion setting) in git?

Alexander Bird picture Alexander Bird · Mar 3, 2011 · Viewed 12.4k times · Source

I noticed a default option in git core.repositoryFormatVersion which defaults to 0, but what are "repository format versions" and what functional difference do they make?

Answer

hobbs picture hobbs · Mar 3, 2011

It's for future compatibility -- if the git developers ever find it necessary to change the way that repos are stored on disk to enable some new feature, then they can make upgraded repos have a core.repositoryformatversion of 1. Then newer versions of git that know about that new format will trigger the code to deal with it, and older versions of git that don't will gracefully error with "Expected git repo version <= 0, found 1. Please upgrade Git".

As of now, the only repo format version defined or recognized is 0, which denotes the format that every public release of git has used.