Git 存储库向后兼容性

发布于 2024-08-02 12:05:07 字数 149 浏览 6 评论 0原文

我只是有一个关于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

若相惜即相离 2024-08-09 12:05:07

它在信息的实际存储方面具有极强的向后兼容性,这就是您在这种情况下所担心的。我不是一个完全的专家,但我怀疑自第一个稳定版本以来这种情况是否发生了变化。

我能想到的唯一兼容性问题是,两个版本的 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.

箜明 2024-08-09 12:05:07

git 存储库布局中很少有不兼容的更改;不兼容是指旧版本可能无法处理用新版本创建的存储库,或者与新服务器进行交换(获取或推送)。

您应该检查 RelNotes(例如来自此处)以查找是否有您使用的版本之间存在一些不兼容的更改。

一些(可能是全部)不兼容的更改是:

  • 子模块支持:在 git core 中引入子模块支持之前的 git 版本将无法处理使用子模块的存储库(它不理解子树/gitlink 条目) )
  • 打包引用:旧的 git 版本无法通过 HTTP 从使用打包引用的较新存储库中获取 (.git/packed-refs)。与使用与新 git 相同的存储库的旧 git 相同,新 git 已打包引用
  • 偏移增量包文件:旧 git 不理解更新(更紧凑)版本的 git packfile (ofs-delta)。这对于获取和推送来说不是问题,因为服务器发现了客户端支持的功能。

我认为这些版本都不在 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:

  • 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文