因此把git服务器搭建在Linux中。
3.1.依赖环境
Git需要很多依赖环境:因此安装git需要先安装下列软件:[root@itcast-01 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel gcc-c++
3.2.安装git
上传git安装包:
安装包:git-2.9.3.tar.gz
tar -xvf git-2.9.3.tar.gz
安装命令:(进入git解压目录)
[root@itcast-01 git-2.9.3]# make prefix=/usr/local all
[root@itcast-01 git-2.9.3]# make prefix=/usr/local install
3.3.创建git用户
添加Linux的用户,用户名为git的用户:
[root@itcast-01 ~]# useradd git
设置git用户的密码
[root@itcast-01 ~]# passwd git
切换到git用户
[root@itcast-01 ~]# su - git
3.4.初始化仓库
初始化仓库,仓库名为taotao.git:
[git@itcast-01 root]$ cd
[git@itcast-01 ~]$ git init --bare taotao.git
始化空的 Git 仓库于 /home/git/taotao.git/
4.1.检入代码
4.1.1.设置使用Git
启动两个eclipse
开发人员一:配置另外一个eclipse,上传项目
创建一个类
package com.taotao1.test;
public class TestA {
public static void main(String[] args) {
System.out.println(“1”);
}
}