本文最后更新于 2026-08-10T23:33:41+08:00
安装依赖包 1 2 sudo yum -y install make autoconf automake cmake perl-CPAN libcurl-devel libtool gcc gcc-c++ glibc-headers zlib-devel git-lfs telnet ctags lrzsz jq expat-devel openssl-devel
安装新版 Git 包 1 2 3 4 5 6 7 8 9 cd /tmp wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.2.tar.gz tar -xvzf git-2.30.2.tar.gzcd git-2.30.2/ ./configure makesudo make install git --version git version 2.30.2
常用配置命令 1 2 3 4 5 6 7 8 9 10 11 12 13 git config --global user.name "chaggle" 用户名改成自己的 git config --global user.email "chaggle@foxmail.com" 邮箱改成自己的 git config --global credential.helper store git config --global core.longpaths true git config --global core.quotepath off git config --global url."https://gitclone.com/" .insteadOf "https://" git lfs install --skip-repo
GitHub 代理配置 这里博主为了稳定性考虑,只推荐 https://gitclone.com 网站,其余的代理都容易失效
1 2 3 4 git clone https://github.com/kubernetes/kubernetes.git git clone https://gitclone.com/github.com/kubernetes/kubernetes.git
但是提交 Git 仓库的时候,需要将代理地址进行还原,否则就会上传到代理地址对应的 Git 仓库!
HTTPS 与 SSH clone 的稳定性问题 一般建议在网络环境友好的情况下使用 HTTPS 协议,配置简单;而网络环境差的情况下使用 SSH 协议,因为 SSH 建立的传输链接不容易丢失。