简体   繁体   English

我可以在安装了不同Git版本的机器之间安全地移动Git存储库吗?

[英]Can I safely move a Git repository between machines with different Git version installed?

Say I have a client pc with Git version 1.6 and a server with Git v.1.7.1. 假设我有一台带有Git 1.6版本的客户端电脑和一台带有Git v.1.7.1的服务器。

On the client I create a bare Git repo, 在客户端我创建一个简单的Git仓库,

Later on, I move this repo from the client machine to the server one where Git v.1.7.1 is installed. 稍后,我将此repo从客户端计算机移动到安装了Git v.1.7.1的服务器。

What is wrong with this picture? 这幅画怎么了?

And, eventually, what is the best practice for moving a Git repo between machines with different Git version installed? 最终,在安装了不同Git版本的机器之间移动Git存储库的最佳实践是什么?

Nothing is wrong with that picture. 那张图片没问题。 The repository format hasn't changed. 存储库格式未更改。

About the worst thing that could happen: if you moved a repo to a computer with an older version of Git, it's possible you might have parameters in .git/config which didn't exist yet in the older version, and they'd be ignored. 关于可能发生的最糟糕的事情:如果你将一个repo移动到一台带有版本Git的计算机上,你可能会在.git / config中找到旧版本中尚不存在的参数,它们就是忽略。 (Assuming by "move" you mean directly copying files - even this wouldn't be an issue if you were just cloning, since that doesn't copy .git/config.) (假设通过“移动”意味着直接复制文件 - 即使这只是一个问题,如果你只是克隆,因为它不会复制.git / config。)

So... best practice? 那么......最佳实践? Just do it however is convenient. 只是这样做很方便。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM