阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Ubuntu系统上安装Git

157次阅读
没有评论

共计 2790 个字符,预计需要花费 7 分钟才能阅读完成。

Git 是一个开源的分布式版本控制系统,它在全球范围内得到广泛的使用。互联网上还有像 GitHub 这样的网站提供了免费的 Git 服务,很多流行的开源项目都使用了 Git 来托管项目,比如 Perl、Ruby on Rails、Linux 内核项目等。

在 Ubuntu 系统上安装 Git 的最佳方式是使用 Ubuntu 软件仓库提供的软件包,这些软件包都是经过了充分测试的,已经完成了预编译,安装或卸载都非常方便。

下面我们将在线更新服务器上的软件仓库索引,保证安装的 Git 服务器是比较新的稳定版。

1、升级系统并更新库索引
# apt-get update
# apt-get upgrade
2、安装 Git 服务
完成了更新操作后,就可以开始安装 Git 服务了。

# apt-get install git-core
Reading package lists… Done
Building dependency tree     
Reading state information… Done
The following extra packages will be installed:
  git git-man liberror-perl
Suggested packages:
  git-daemon-run git-daemon-sysvinit git-doc git-el git-arch
  git-cvs git-svn git-email git-gui gitk gitweb
The following NEW packages will be installed:
  git git-core git-man liberror-perl
0 upgraded, 4 newly installed, 0 to remove and 100 not upgraded.
Need to get 6,752 kB of archives.
After this operation, 15.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ precise/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main git-man all 1:1.7.9.5-1ubuntu0.1 [631 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main git amd64 1:1.7.9.5-1ubuntu0.1 [6,097 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main git-core all 1:1.7.9.5-1ubuntu0.1 [1,380 B]
Fetched 6,752 kB in 1s (3,712 kB/s) 
Selecting previously unselected package liberror-perl.
(Reading database … 51734 files and directories currently installed.)
Unpacking liberror-perl (from …/liberror-perl_0.17-1_all.deb) …
Selecting previously unselected package git-man.
Unpacking git-man (from …/git-man_1%3a1.7.9.5-1ubuntu0.1_all.deb) …
Selecting previously unselected package git.
Unpacking git (from …/git_1%3a1.7.9.5-1ubuntu0.1_amd64.deb) …
Selecting previously unselected package git-core.
Unpacking git-core (from …/git-core_1%3a1.7.9.5-1ubuntu0.1_all.deb) …
Processing triggers for man-db …
Setting up liberror-perl (0.17-1) …
Setting up git-man (1:1.7.9.5-1ubuntu0.1) …
Setting up git (1:1.7.9.5-1ubuntu0.1) …
Setting up git-core (1:1.7.9.5-1ubuntu0.1) …
3、基本的配置
一旦完成以上安装过程,就该进行 Git 服务的配置。最基本的配置是这样的:

# git config –global user.name “linuxidc”
# git config –global user.email linuxidc@linuxidc.net
可以根据自己的实际,替换用户名和密码。

GitHub 教程系列文章

GitHub 使用教程图文详解  http://www.linuxidc.com/Linux/2014-09/106230.htm 

Git 标签管理详解 http://www.linuxidc.com/Linux/2014-09/106231.htm 

Git 分支管理详解 http://www.linuxidc.com/Linux/2014-09/106232.htm 

Git 远程仓库详解 http://www.linuxidc.com/Linux/2014-09/106233.htm 

Git 本地仓库(Repository)详解 http://www.linuxidc.com/Linux/2014-09/106234.htm 

Git 服务器搭建与客户端安装  http://www.linuxidc.com/Linux/2014-05/101830.htm 

Git 概述 http://www.linuxidc.com/Linux/2014-05/101829.htm 

分享实用的GitHub 使用教程 http://www.linuxidc.com/Linux/2014-04/100556.htm 

Ubuntu 下 Git 服务器的搭建与使用指南  http://www.linuxidc.com/Linux/2015-07/120617.htm

Git 的详细介绍:请点这里
Git 的下载地址:请点这里

更多 Ubuntu 相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-09/123301.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计2790字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中