views:

481

answers:

2

I just had a quick question about git - how backwards compatible are git repositories? Eg., I've created a repository using git 1.6.4 and the svn2git ruby script, but I want to put it on a machine that's running Debian Lenny, which has git 1.5.6.5. Would I still be able to interact with the repository properly?

+2  A: 

It's extremely backward compatible in terms of the actual storage of information, which is all you're worried about in this case. I'm not a total expert, but I doubt that's changed since the first stable release.

The only compatibility problem I can think come up with is if the two versions of git are working on the exact same repo (not clones) and there are options/aliases set in the .git/config that work in the newer version but were not [fully] implemented in the older version... but even then you'd have to try pretty hard with versions this close. And again, this isn't anything to do with the actual information in the repo, just the commands you use to manage it. That's where the development of git is taking place.

Jefromi
Well, I know that in an early 1.5 release the repository format was changed, but I guess that's all. Thanks, I can probably proceed with my work.I wonder though, would gitosis have problems with older versions? I want to set up gitosis on this new Lenny server. I guess it should be able to receive pushes and stuff fine.
Ibrahim
Some things changed with 1.5, but see here how cautious they are:http://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.5.0.txtThe things that changed default setting, work from version 1.4.3 (at least).
kaizer.se
Ha! Destroying your perfectly evil reputation of 666 with a +1!
Bombe
+1  A: 

There were very few incompatibile changes in layout of git repository; incompatibile in the sense that older version could be not able to deal with repository created with newer version, or do an exchange (fetch or push) with newer server.

You should check RelNotes (e.g. from here) to find if there was some incompatibile change between versions you use.

Some (probably all) of those incompatibile changes are:

  • submodules support: git version before submodule support was introduced in git core will not be able to handle repository which uses submodules (it does not understand subtree/gitlink entries)
  • packed refs: old git version would not be able to fetch via HTTP from newer repository that uses packed refs (.git/packed-refs). Same with old git using the same repository as new git which has packed refs
  • offset delta packfiles: old git doesn't understand newer (more compact) version of git packfile (ofs-delta). This is not a problem for fetching and pushing, as there is discovery of features client supports by server.

None of those were between 1.6.4 and 1.5.6, I think.

Jakub Narębski