Git 存储库向后兼容性
我只是有一个关于 git 的快速问题 - git 存储库向后兼容的程度如何?例如,我使用 git 1.6.4 和 svn2git ruby 脚本创建了一个存储库,但我想将其放在运行 Debian Lenny(具有 git 1.5.6.5)的计算机上。我仍然能够与存储库正确交互吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它在信息的实际存储方面具有极强的向后兼容性,这就是您在这种情况下所担心的。我不是一个完全的专家,但我怀疑自第一个稳定版本以来这种情况是否发生了变化。
我能想到的唯一兼容性问题是,两个版本的 git 是否在完全相同的存储库(而不是克隆)上工作,并且 .git/config 中设置了在较新版本中工作但不是的选项/别名[完全]在旧版本中实现......但即便如此,您也必须非常努力地尝试如此接近的版本。再说一遍,这与存储库中的实际信息无关,而与您用来管理它的命令有关。这就是 git 开发的地方。
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.
git 存储库布局中很少有不兼容的更改;不兼容是指旧版本可能无法处理用新版本创建的存储库,或者与新服务器进行交换(获取或推送)。
您应该检查 RelNotes(例如来自此处)以查找是否有您使用的版本之间存在一些不兼容的更改。
一些(可能是全部)不兼容的更改是:
.git/packed-refs
)。与使用与新 git 相同的存储库的旧 git 相同,新 git 已打包引用我认为这些版本都不在 1.6.4 和 1.5.6 之间。
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:
.git/packed-refs
). Same with old git using the same repository as new git which has packed refsNone of those were between 1.6.4 and 1.5.6, I think.