2

They look quite similar, but I am not sure, if it would be a good idea to simply use the git 1 repo with the git 2 tools.

Does some upgrade possibility exist?


Edit: also the "upgrade isn't needed", or "you can't upgrade" answers can be acceptable, because they answer the question.

peterh
  • 11,875
  • 18
  • 85
  • 108
  • Did you encounter any issues using the repo with Git version 2? – axiac Mar 22 '17 at 14:34
  • What do you mean by "git 1" and "git 2"? – torek Mar 22 '17 at 14:34
  • @axiac I find continuously significant issues between concurrently used significantly different git versions. – peterh Mar 22 '17 at 14:34
  • @torek git 1 is the older git version. Currently we use 2.7.4. Between git 1 and git 2 happened a significant binary format change (as far I know), and sometimes even between minor number switches there are issues. – peterh Mar 22 '17 at 14:35
  • So you mean `git 1.7.x` or `git 1.8.x` and `git 2.7.4`? (i.e., Git version numbers) – torek Mar 22 '17 at 14:36
  • @torek git 1.7.9.4 from an ubuntu 12.04 LTS. Also I don't know yet, exactly which git 2 version will I use, but probably a newer one. Between git 2 minor number versions I didn't find major problems. I will use probably the answer [here](https://askubuntu.com/questions/571549/git-1-7-9-5-upgrade-to-current-release-of-git-2-x-on-ubuntu-12-04). – peterh Mar 22 '17 at 14:38
  • Related: http://stackoverflow.com/q/26884027/1079354; main point is that there have been some backwards-incompatible changes with the client and certain function behaviors, but AFAIK the actual Git backing remains compatible with an older repository. – Makoto Mar 22 '17 at 14:44

1 Answers1

2

There were few internal data format changes between 1.7.11 and any of the current 2.x releases, but v1.7.11 did itself introduce a new v4 index (as in .git/index) file format, and v2.3.0 introduced a new "split index" option. These are all upwards-compatible changes, i.e., you can use a newer Git version on any existing repository, including ones with existing index files.

If you run a newer Git that replaces an older v2 index with a newer v4 one, and then need to run the older Git version again for some reason, you can simply remove and rebuild the index (of course this drops anything staged, or any in-progress merge).

There is now the ability to change the on-disk repository format, as of Git version 2.6.3 (the existing format is now labeled "version 1") but no new format has been introduced yet.

In any case, you can always git clone from an older Git version to a newer Git version and vice versa. (Use a --mirror clone to copy all references. Decide whether to keep the remote, and if so, whether to update the fetch line, once you have the clone.)

Obviously, there are new features (new push.default settings, for instance, and git worktree add) that older Gits will not understand or use, but the actual repository format itself is still the same.

torek
  • 448,244
  • 59
  • 642
  • 775