全部博文(626)
分类: LINUX
2015-09-03 18:51:52
在Ubuntu系统上安装Git的最佳方式是使用Ubuntu软件仓库提供的软件包,这些软件包都是经过了充分测试的,已经完成了预编译,安装或卸载都非常方便。
下面我们将在线更新服务器上的软件仓库索引,保证安装的Git服务器是比较新的稳定版。
# apt-get update
# apt-get upgrade
完成了更新操作后,就可以开始安装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 precise/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 precise-updates/main git-man all 1:1.7.9.5-1ubuntu0.1 [631 kB]
Get:3 precise-updates/main git amd64 1:1.7.9.5-1ubuntu0.1 [6,097 kB]
Get:4 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) ...
一旦完成以上安装过程,就该进行Git服务的配置。最基本的配置是这样的:
# git config --global user.name "jieforest"
# git config --global user.email jieforest@chinaunix.net
可以根据自己的实际,替换用户名和密码。