开发者之间不同版本的git [英] different versions of git between developers

查看:138
本文介绍了开发者之间不同版本的git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我已经安装了GIT 1.9.4的版本,并且服务器上的存储库使用了1.8.2,那么会出现问题吗?使用不同版本的GIT有什么问题吗?在团队中每个人都应该有相同的版本,或者没有关系吗?

可以在文档中找到任何信息,我会很感激您的帮助。

解决方案

1.9.4和1.8.2非常接近,但可能有几个问题在不同的git版本之间,主要是不同的行为。

如果你想知道改变了什么,你可以检查git仓库( https://github.com/git/git )。

在本地克隆它,然后在 Documentation / RelNotes 目录(您可以定位1.8和1.9版本):

  git clone git@github.com:git / git.git 
grepcompatibilityDocumentation / RelNotes / 1。[89] * -n




Documentation / RelNotes / 1.8.0.txt:4:向后兼容性说明

Documentation / RelNotes / 1.8.1.txt :4:向后兼容性n otes

Documentation / RelNotes / 1.8.2.txt:4:向后兼容性说明(此发行版)

文档/ RelNotes / 1.8.2.txt:25:向后兼容性说明for Git 2.0)

Documentation / RelNotes / 1.8.3.txt:4:向后兼容性说明(适用于Git 2.0)

文档/ RelNotes / 1.8.4.txt:4:向后兼容性说明(适用于Git 2.0)

Documentation / RelNotes / 1.8.5.txt:4:向后兼容性说明(适用于Git 2.0)

Documentation / RelNotes / 1.9.0。 txt:4:向后兼容性说明

Documentation / RelNotes / 1.9.0.txt:30:向后兼容性说明(适用于Git 2.0.0)

您只关注1.8.3+版本,并且您可以看到大多数兼容性问题都与Git 2.0有关。唯一有意思的是这一行:


Documentation / RelNotes / 1.9.0.txt:4:向后兼容性说明 p>

您可以看看 1.9.0.txt ,您会看到:


  • git submodules foreach $ cmd $ args 行为已得到增强

  • 松散对象格式已被删除

  • git fetch --tags 行为已更改
  • >
  • git push $ there $什么已被增强
  • repo-config , tar-tree lost-found peek -remote 已被删除



没有任何警告,但 git fetch --tags 更改,您不应该有任何兼容性问题。无论如何,仔细阅读全文:


向后兼容性说明



git submodule foreach $ cmd $ args用来对待$ cmd $ args同样的
方式的ssh,将它们连接成单个字符串并让
shell不引用。不小心引用$ args
的粗心用户在shell的$ IFS空格处得到他们的参数分裂,并且由此得到
的意外结果。从这个版本开始,
命令行直接传递给shell,如果它有参数的话。



对实验松散对象格式的只读支持,其中用户
可以选择在v1.4.3和v1.5.3时代之间选择将自己的松散对象编写为短
,已被放弃。



git fetch的--tags选项的含义已经改变;
命令除 外还获取标签由同一个
命令行获取的内容,而不包含该选项。



git push $ there $ what解释了
命令行给出的部分,当它没有显式地告诉我们
的冒号时,$存储库上的ref将被更新,已经得到了增强。

一些古老的命令早已不再使用,其中
终于消失了(repo-config,tar-tree,lost-found,和peek-remote)。



if I have installed version of GIT 1.9.4 and the repository on server is using 1.8.2 would there be a problem? Are there any issues with working using different versions of GIT? Does every person in a team should have the same version or does it not matter?

Could find any info on that in docs, I'd be grateful for your help.

解决方案

1.9.4 and 1.8.2 are pretty close, but there may have a few problems between different git versions, mainly varying behaviors.

If you want to know what have changed, you can check git repository (https://github.com/git/git).
Clone it locally, and search for "compatibility" in the Documentation/RelNotes directory (you can target 1.8 and 1.9 versions):

git clone git@github.com:git/git.git
grep "compatibility" Documentation/RelNotes/1.[89]* -n

Documentation/RelNotes/1.8.0.txt:4:Backward compatibility notes
Documentation/RelNotes/1.8.1.txt:4:Backward compatibility notes
Documentation/RelNotes/1.8.2.txt:4:Backward compatibility notes (this release)
Documentation/RelNotes/1.8.2.txt:25:Backward compatibility notes (for Git 2.0)
Documentation/RelNotes/1.8.3.txt:4:Backward compatibility notes (for Git 2.0)
Documentation/RelNotes/1.8.4.txt:4:Backward compatibility notes (for Git 2.0)
Documentation/RelNotes/1.8.5.txt:4:Backward compatibility notes (for Git 2.0)
Documentation/RelNotes/1.9.0.txt:4:Backward compatibility notes
Documentation/RelNotes/1.9.0.txt:30:Backward compatibility notes (for Git 2.0.0)

You're only concerned by 1.8.3+ releases, and you can see most of compatibility issues concern Git 2.0. The only one line that is interesting is this one:

Documentation/RelNotes/1.9.0.txt:4:Backward compatibility notes

It you take a look to 1.9.0.txt, you'll see:

  • git submodules foreach $cmd $args behavior has been enhanced
  • loose-object format has been dropped
  • git fetch --tags behavior has changed
  • git push $there $what has been enhanced
  • repo-config, tar-tree, lost-found, and peek-remote have been dropped

Nothing alarming but git fetch --tags changes, you shouldn't have any compatibility problem. Anyway, read carefully the full text:

Backward compatibility notes

"git submodule foreach $cmd $args" used to treat "$cmd $args" the same way "ssh" did, concatenating them into a single string and letting the shell unquote. Careless users who forget to sufficiently quote $args get their argument split at $IFS whitespaces by the shell, and got unexpected results due to this. Starting from this release, the command line is passed directly to the shell, if it has an argument.

Read-only support for experimental loose-object format, in which users could optionally choose to write their loose objects for a short while between v1.4.3 and v1.5.3 era, has been dropped.

The meanings of the "--tags" option to "git fetch" has changed; the command fetches tags in addition to what is fetched by the same command line without the option.

The way "git push $there $what" interprets the $what part given on the command line, when it does not have a colon that explicitly tells us what ref at the $there repository is to be updated, has been enhanced.

A handful of ancient commands that have long been deprecated are finally gone (repo-config, tar-tree, lost-found, and peek-remote).

这篇关于开发者之间不同版本的git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆