首页 > 编程知识 正文

linux环境变量配置文件,linux环境变量配置添加

时间:2023-05-04 20:32:33 阅读:234137 作者:4828

cd /usr/local

mkdir git

cd git 

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker

wget https://github.com/git/git/archive/v2.3.0.zip

unzip v2.3.0.zip

cd git-2.3.0

make prefix=/usr/local/git all

sudo make prefix=/usr/local/git install

whereis git

 

如果你是centsos 7自带git1.8要自己先yum remove git  删除git1.8,,此外去看下/etc/profile.d/git.sh 删干净再来执行下面与配置/etc/profile一个效果

[root@bogon git-2.3.0]# echo "export PATH=$PATH:/usr/local/git/bin" > /etc/profile.d/git.sh[root@bogon git-2.3.0]# source /etc/profile.d/git.sh[root@bogon git-2.3.0]# git --versiongit version 2.3.0[root@bogon git-2.3.0]# total 6196

[root@bogon git]# git config --global user.name "chen1932390299"[root@bogon git]# git config --global user.email 1932390299@qq.com[root@bogon git]# git config --listuser.name=chen1932390299user.email=1932390299@qq.com[root@bogon git]# cd git-repo/[root@bogon git-repo]# echo “README” > readme.txt[root@bogon git-repo]# lltotal 4-rw-r--r--. 1 root root 11 Apr 20 15:04 readme.txt[root@bogon git-repo]# git initInitialized empty Git repository in /usr/local/git/git-repo/.git/[root@bogon git-repo]# cd ~[root@bogon ~]# mkdir .ssh[root@bogon ~]# cd .ssh[root@bogon .ssh]# ssh-keygen -t rsa -C "1932390299@qq.com"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 1932390299@qq.comThe key's randomart image is:+--[ RSA 2048]----+| || + || . E + || . . .oB ||.. . ..=S. ||... ..o ||.. o.o . || .+ ...o || ... oo. |+-----------------+[root@bogon .ssh]# cat id_rsa.pubssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5wZoqfl3kpLnugTku4J10JhuKJLZq/0RBBfsRrO7OtBzjBjnGCBvdGY3K+2m0IMu5UGhXgdBRPMVtxKG1QlYxKEVmgQpaEpZnsXsG0wDKHsgrn3oBgD59mpdvIGOh6korJ/GBlYRF4Djw0YmtTRFTcv5Jx5AAo7lTXYkJttcm4rxFhLsXg/gZNoyBlRzH+AQXQQjajYyvnx4+dJMXxEizrebNSmVxnLyotGovCnza/jSC617ASi0AOoyrWM5RHUsvnf92LmUwk+LR6Eyz97Aa6tyl1r5G8sR0VV/k+koxKHSXxn1cxozmNPdqJZ2fLiisUp9oTa0S9I3RCqS7zAWLw== 1932390299@qq.com[root@bogon .ssh]#

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。