linux 安装git环境变量配置
Posted 入门到放弃
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 安装git环境变量配置相关的知识,希望对你有一定的参考价值。
cd /usr/local
mkdir git
源码安装
cd git
wget https://www.kernel.org/pub/software/scm/git/git-2.7.3.tar.gz
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
tar xf git-2.7.3.tar.gz
cd git-2.7.3
make configure
./configure --prefix=/usr/local/git
make profix=/usr/local/git
make install
配置环境
[[email protected] git-2.3.0]# echo "export PATH=$PATH:/usr/local/git/bin" > /etc/profile.d/git.sh [[email protected] git-2.3.0]# source /etc/profile.d/git.sh [[email protected] git-2.3.0]# git --version git version 2.3.0 [[email protected] git-2.3.0]#
[[email protected] local]# cd git
[[email protected] git]# mkdir -p git-repo
[[email protected] git]# ll
total 6196
[[email protected] git]# git config --global user.name "chen1932390299" [[email protected] git]# git config --global user.email [email protected] [[email protected] git]# git config --list user.name=chen1932390299 [email protected] [[email protected] git]# cd git-repo/ [[email protected] git-repo]# echo “README” > readme.txt [[email protected] git-repo]# ll total 4 -rw-r--r--. 1 root root 11 Apr 20 15:04 readme.txt [[email protected] git-repo]# git init Initialized empty Git repository in /usr/local/git/git-repo/.git/ [[email protected] git-repo]# cd ~ [[email protected] ~]# mkdir .ssh [[email protected] ~]# cd .ssh [[email protected] .ssh]# ssh-keygen -t rsa -C "[email protected]" Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 8c:fa:e5:3a:a4:48:c8:fe:58:41:7f:99:5c:e6:90:8d [email protected] The key‘s randomart image is: +--[ RSA 2048]----+ | | | + | | . E + | | . . .oB | |.. . ..=S. | |... ..o | |.. o.o . | | .+ ...o | | ... oo. | +-----------------+ [[email protected] .ssh]# cat id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5wZoqfl3kpLnugTku4J10JhuKJLZq/0RBBfsRrO7OtBzjBjnGCBvdGY3K+2m0IMu5UGhXgdBRPMVtxKG1QlYxKEVmgQpaEpZnsXsG0wDKHsgrn3oBgD59mpdvIGOh6korJ/GBlYRF4Djw0YmtTRFTcv5Jx5AAo7lTXYkJttcm4rxFhLsXg/gZNoyBlRzH+AQXQQjajYyvnx4+dJMXxEizrebNSmVxnLyotGovCnza/jSC617ASi0AOoyrWM5RHUsvnf92LmUwk+LR6Eyz97Aa6tyl1r5G8sR0VV/k+koxKHSXxn1cxozmNPdqJZ2fLiisUp9oTa0S9I3RCqS7zAWLw== [email protected] [[email protected] .ssh]#
以上是关于linux 安装git环境变量配置的主要内容,如果未能解决你的问题,请参考以下文章
Windows 在 git bash下使用 conda 命令