0. 概述

因为 CentOS 自带的 Yum Repo 中安装的 git 版本太老了,所以我需要手动升级一下。

1. 设置 Repo

  1. [[email protected].io]# yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm

2. 升级 git

  1. [[email protected].io]# yum install git
  2. Loaded plugins: fastestmirror, langpacks
  3. Loading mirror speeds from cached hostfile
  4. * base: mirrors.ocf.berkeley.edu
  5. * extras: mirrors.ocf.berkeley.edu
  6. * nux-dextop: li.nux.ro
  7. * updates: repos.lax.quadranet.com
  8. Resolving Dependencies
  9. --> Running transaction check
  10. ---> Package git.x86_64 0:1.8.3.1-20.el7 will be updated
  11. --> Processing Dependency: git = 1.8.3.1-20.el7 for package: perl-Git-1.8.3.1-20.el7.noarch
  12. ---> Package git.x86_64 0:2.22.0-1.WANdisco.437 will be an update
  13. --> Running transaction check
  14. ---> Package perl-Git.noarch 0:1.8.3.1-20.el7 will be updated
  15. ---> Package perl-Git.noarch 0:2.22.0-1.WANdisco.437 will be an update
  16. --> Finished Dependency Resolution
  17. Dependencies Resolved
  18. =======================================================================================================================================================
  19. Package Arch Version Repository Size
  20. =======================================================================================================================================================
  21. Updating:
  22. git x86_64 2.22.0-1.WANdisco.437 WANdisco-git 8.4 M
  23. Updating for dependencies:
  24. perl-Git noarch 2.22.0-1.WANdisco.437 WANdisco-git 23 k
  25. Transaction Summary
  26. =======================================================================================================================================================
  27. Upgrade 1 Package (+1 Dependent package)
  28. Total download size: 8.4 M
  29. Is this ok [y/d/N]: y
  30. Downloading packages:
  31. No Presto metadata available for WANdisco-git
  32. warning: /var/cache/yum/x86_64/7/WANdisco-git/packages/perl-Git-2.22.0-1.WANdisco.437.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 3bbf077a: NOKEY
  33. Public key for perl-Git-2.22.0-1.WANdisco.437.noarch.rpm is not installed
  34. (1/2): perl-Git-2.22.0-1.WANdisco.437.noarch.rpm | 23 kB 00:00:01
  35. (2/2): git-2.22.0-1.WANdisco.437.x86_64.rpm | 8.4 MB 00:00:05
  36. -------------------------------------------------------------------------------------------------------------------------------------------------------
  37. Total 1.7 MB/s | 8.4 MB 00:00:05
  38. Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-WANdisco
  39. Importing GPG key 0x3BBF077A:
  40. Userid : "WANdisco (http://WANdisco.com - We Make Software Happen...) <[email protected]>"
  41. Fingerprint: 69c1 be83 da54 cbed 6889 72f8 e9f0 e922 3bbf 077a
  42. From : /etc/pki/rpm-gpg/RPM-GPG-KEY-WANdisco
  43. Is this ok [y/N]: y
  44. Running transaction check
  45. Running transaction test
  46. Transaction test succeeded
  47. Running transaction
  48. Updating : git-2.22.0-1.WANdisco.437.x86_64 1/4
  49. Updating : perl-Git-2.22.0-1.WANdisco.437.noarch 2/4
  50. Cleanup : git-1.8.3.1-20.el7.x86_64 3/4
  51. Cleanup : perl-Git-1.8.3.1-20.el7.noarch 4/4
  52. Verifying : perl-Git-2.22.0-1.WANdisco.437.noarch 1/4
  53. Verifying : git-2.22.0-1.WANdisco.437.x86_64 2/4
  54. Verifying : git-1.8.3.1-20.el7.x86_64 3/4
  55. Verifying : perl-Git-1.8.3.1-20.el7.noarch 4/4
  56. Updated:
  57. git.x86_64 0:2.22.0-1.WANdisco.437
  58. Dependency Updated:
  59. perl-Git.noarch 0:2.22.0-1.WANdisco.437
  60. Complete!

完工,测试一下。

3. 测试效果

  1. [[email protected].io]# git version
  2. git version 2.22.0

4. Ref