centos 安装配置git客户端与github连接

参考来源:http://www.cnblogs.com/zhcncn/p/4030078.html
参考来源:https://blog.csdn.net/lp112124/article/details/53924330
在CentOS6以上版本的yum源中有git的版本了,可以直接使用yum源进行安装。
$ sudo yum install git
但是yum源中安装的git版本是1.7.1,太老了,Github等需要的Git版本最低都不能低于1.7.2 。所以我们一般不用上面的方法。而是下载git源码,编译安装。
编译安装的步骤是【3】:

(1)安装依赖的包


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

(2)下载git源码并解压缩


$ wget https://github.com/git/git/archive/v2.3.0.zip
$ unzip v2.3.0.zip
$ cd git-2.3.0

(3)编译安装


将其安装在“/usr/local/git”目录下。

make prefix=/usr/local/git all
sudo make prefix=/usr/local/git install

(4)此时你如果使用git --version 查看git版本

发现git仍然是1.7.1版本。这是因为它默认使用了"/usr/bin"下的git。


你可以用下面的命令查看git所在的路径:

$ whereis git
git: /usr/bin/git /usr/local/git /usr/share/man/man1/git.1.gz

(5)我们要把编译安装的git路径放到环境变量

让它替换"/usr/bin"下的git。为此我们可以修改“/etc/profile”文件(或者/etc/bashrc文件)。


sudo vim /etc/profile

然后在文件的最后一行,添加下面的内容,然后保存退出。

export PATH=/usr/local/git/bin:$PATH

(6)使用source命令应用修改。


source /etc/profile

(7)然后再次使用git --version 查看git版本

发现输出2.3.0,表明安装成功。


git --version

(8)关于与git与github交互

http://blog.csdn.net/lp112124/article/details/53763065


原文:https://blog.csdn.net/lp112124/article/details/53924330

阅读 185

Comments

p

ps4 games 5小时前

Greetings from Ohio! I'm bored at work so I decided to browse your blog on my iphone during lunch break. I enjoy the info you provide here and can't wait to take a look when I get home. I'm shocked at how fast your blog loaded on my cell phone .. I'm not even using WIFI, just 3G .. Anyways, very good blog!

回复此评论

p

ps4 games 1天前

Whats up this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I'm starting a blog soon but have no coding experience so I wanted to get guidance from someone with experience. Any help would be greatly appreciated!

回复此评论

p

ps4 games 3天前

Good day! This post could not be written any better! Reading through this post reminds me of my good old room mate! He always kept talking about this. I will forward this page to him. Pretty sure he will have a good read. Many thanks for sharing!

回复此评论

p

ps4 games 3天前

Wonderful website you have here but I was wanting to know if you knew of any community forums that cover the same topics talked about in this article? I'd really like to be a part of community where I can get feedback from other experienced individuals that share the same interest. If you have any recommendations, please let me know. Bless you!

回复此评论

q

quest bars cheap 5天前

Hey There. I found your weblog the use of msn. This is a really well written article. I'll make sure to bookmark it and return to learn more of your helpful info. Thanks for the post. I'll certainly return.

回复此评论

q

quest bars cheap 6天前

Thank you for some other fantastic post. The place else may just anyone get that type of info in such a perfect means of writing? I have a presentation subsequent week, and I'm on the search for such information.

回复此评论

p

ps4 games 1周前

Keep this going please, great job!

回复此评论

p

ps4 games 1周前

Hi to every one, the contents existing at this website are in fact remarkable for people knowledge, well, keep up the good work fellows.

回复此评论

p

ps4 games 1周前

Your means of telling everything in this paragraph is truly good, every one can effortlessly know it, Thanks a lot.

回复此评论

q

quest bars cheap coupon twitter 1周前

If you want to improve your know-how only keep visiting this web page and be updated with the latest gossip posted here.

回复此评论

q

quest bars cheap coupon twitter 1周前

Heya i'm for the first time here. I came across this board and I find It really useful & it helped me out a lot. I hope to give something back and aid others like you aided me.

回复此评论

q

quest bars cheap 1周前

What's Taking place i am new to this, I stumbled upon this I have found It positively helpful and it has aided me out loads. I'm hoping to contribute & help different users like its aided me. Great job.

回复此评论

p

ps4 games 1周前

Great delivery. Great arguments. Keep up the good effort.

回复此评论

q

quest bars cheap 2周前

I think the admin of this site is actually working hard in support of his web site, for the reason that here every stuff is quality based data.

回复此评论

p

ps4 games 2周前

I was recommended this web site by my cousin. I'm not sure whether this post is written by him as nobody else know such detailed about my trouble. You're incredible! Thanks!

回复此评论

c

coconut oil why 2周前

I was recommended this web site through my cousin. I am not sure whether or not this publish is written by him as nobody else recognise such special approximately my problem. You are incredible! Thanks!

回复此评论

t

tinyurl.com 2周前

This is really interesting, You're a very skilled blogger. I have joined your feed and look forward to seeking more of your excellent post. Also, I've shared your site in my social networks!

回复此评论

t

tinyurl.com 2周前

Heya i'm for the primary time here. I found this board and I to find It truly helpful & it helped me out much. I am hoping to present something back and aid others like you helped me.

回复此评论