在Ubuntu搭建Git

在Ubuntu搭建Git

作者:chszs,版权所有,未经同意,不得转载。博主主页:http://blog.csdn.net/chszs

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 "chszs"
# git config --global user.email [email protected]

可以根据自己的实际,替换用户名和密码。

版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。

时间: 2025-01-14 18:12:55

在Ubuntu搭建Git的相关文章

Linux Ubuntu搭建git服务器

1. 安装 openssh-server ,用于创建SSH服务. sudo apt-get install openssl-server 使用命令ps -e|grep ssh,查看ssh服务是否启动. 如果正常启动,则会显示类似信息:1966 ?    00:00:00 ssh-agent 2. 创建用户名为git的用户,用来管理和运行git服务. sudo user del -r git // 删除已经存在的叫git的用户: sudo adducer git // 添加用户名叫git的用户:

转载-ubuntu搭建Git 服务器

本文转载自:http://blog.chinaunix.net/uid-15007890-id-3217101.html 硬件需求:一台linux Ubuntu电脑(虚拟机),在公司局域网内有独立IP,并且保证小组每个人都能ping通:软件需求:git-core, gitosis, openssh-server, openssh-client安装git和openssh:[email protected]:~$ sudo apt-get install git-core[email protect

Ubuntu上搭建Git服务器

下面我们就看看,如何在Ubuntu上搭建Git服务器.我们使用VMware虚拟机安装两台Ubantu系统,分别命名为gitServer和gitClient_01. 1.安装OpenSSH并配置SSH无密码登陆 通过命令 sudo apt-get install openssh-server,安装SSH服务. 通过命令 ps –e|grep ssh,查看ssh服务是否启动. 通过以上命令,我们为Ubantu系统安装SSH服务,并配置SSH无密码登陆,首先我们修改主机和ip配置文件:gedit /e

ubuntu下搭建git服务器

看了一些搭建git服务器的教程,都不是很详细,于是,就有了本文→_→ 环境说明: 本地:win7 IP:192.168.111.1 服务器:ubuntu 14.04 IP:192.168.111.222 服务器上: #安装git,如果有权限问题,记得再以下命令前面加上 sudo apt-get install git #新增用户(用户名为git),用于运行git服务,回车后会提示输入密码 adduser git #初始化git仓库,这里我放到/home/git/code目录下面(专门存放代码用)

ubuntu完美搭建git服务器【转】

转自:http://blog.csdn.net/tommy_wxie/article/details/38779667 最近公司项目需要用到Git来管理项目,正好逢周末花了点时间在虚拟机的unbuntu系统中搭建了下git的服务器,由于搭建过程中多多少少遇到了一些小问题,再因为个人记性不太好,所以在这里记录下来,以备不时之需.开始我已经在虚拟机的ubuntu12.04系统下已经装过一次,忘了记录,这次重新再在虚拟机的ubuntu13.10系统下一步一步的来搭建,后面介绍包括了在客户端机器(宿主机

Ubuntu下 git 服务器的搭建【转】

转自:http://www.open-open.com/lib/view/open1391477731082.html 搭建git服务器的4个步骤 1   配置服务器前的准备工作 首先ubuntu系统要联网 安装了git,openssh-server和openssh-client软件,并检测是否开启. rpm -qa | grep -i git (查看是否安装git) sudo apt-get install git sudo apt-get install openssh-server sud

Ubuntu中Git服务器搭建

git服务器搭建过程 参考网上资料搭建git服务器过程记录 如下: 需求 硬件需求:一台Ubuntu或者debian电脑(虚拟机),能通过网络访问到. 软件需求:git-core, gitosis, openssh-server, openssh-client, Apache2(Gitweb) 安装配置git服务器 安装git和openssh: [email protected]:~$sudo apt-get install git-core openssh-server openssh-cli

Ubuntu简单搭建git私有服务

git服务器搭建过程 搭建git服务器过程记录 如下: 环境: 服务器Ubuntu虚拟机(Boss),能通过网络访问到(服务器地址:192.168.9.103). 客户端Win7电脑一台(work) 软件需求: 客户端软件msysgit:http://msysgit.github.io/ 软件版本:Git-1.9.2-preview20140411.exe 客户端软件TortoiseGit:http://dl.oschina.net/soft/tortoisegit 软件版本:TortoiseG

【Git入门之十三】Ubuntu和git

[Git入门之十三]Ubuntu和git - JackyStudio - 博客频道 - CSDN.NET 之前我们都是在Windows平台下操作git.现在我们改用Ubuntu试一试吧!先准备好Ubuntu或者Linux系统吧.这里采用13.04版本虚拟机环境 1.Ubuntu下使用git 打开终端(Ctrl+Alt+T).Ubuntu下就没有git bash了,都是使用terminal. 1.1.安装SSH ? [cpp]?view plaincopy ? sudo?apt-get?insta