Git使用记录
原创大约 1 分钟
Git使用记录
Windows配置
#配置用户名:
git config --global user.name "s1x6"
#配置邮箱
git config --global user.email "xiaomaohuifaguang@163.com"
#查看配置是否成功
git config --global --list
#成成ssh
ssh-keygen -t rsa
# id_rsa.pub 公钥 去远程仓库配置Linux 安装配置
# 先查看卸载 原有的git -> linux 卸载软件
# 下载编译工具
yum -y groupinstall "Development Tools"
yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel
# 下载源码
# 地址 https://mirrors.edge.kernel.org/pub/software/scm/git/ 或 https://github.com/git/git/tags
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.40.1.tar.gz
tar -zxvf v2.40.1.tar.gz -C ../git
# 设置git安装文件夹,prefix的文件可自定义指定位置但要记住位置,后面会用到
./configure --prefix=/soft/git
# 编译git
make
# 安装git,-j 2可选择不要,此代表使用2个核心去安装,速度会比较快
make install -j 2
# 配置环境变量
vi /etc/profile
PATH=/soft/git/bin:$PATH
source /etc/profile
# 验证
git --version
# 查询代理
git config --global --get http.proxy
git config --global --get https.proxy
# 配置socks5代理
git config --global http.proxy socks5 127.0.0.1:10808
git config --global https.proxy socks5 127.0.0.1:10808
# 配置http代理
git config --global http.proxy 127.0.0.1:10809
git config --global https.proxy 127.0.0.1:10809
# 取消代理命令
git config --global --unset http.proxy
git config --global --unset https.proxy