CentOS 7 自带的 Git 是 1.8,在使用 VS Code 远程到 CentOS 7 的主机上的时候总是提示要升级 Git 到 2.x。我开始以为是要升级我的 Windows 的 Git,后来发现升级以后提示还在。升级 Cent OS 7 的 Git 以后,问题消失。
首先,我们需要指定一个新的 yum 源:
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
然后直接安装 git,注意我们不需要卸载原有的 git
yum install git
查看 git 版本
git --version
参考链接:
如何用 VS Code remote 插件编辑远程 linux 服务器上的文件
https://stackoverflow.com/questions/21820715/how-to-install-latest-version-of-git-on-centos-7-x-6-x