安装:
没有本地安装包,直接在网上下载:
修改yum源:
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
Repo_gpgcheck=0
Enabled=1
gpgcheck=0
安转过程中需要联网:
[root@server1 ~]# yum makecache
[root@server1 ~]# yum install gitlab-ce -y
修改配置:
[root@server1 .ssh]# vim /etc/gitlab/gitlab.rb
------
external_url 'http://172.25.5.1'
------
等好长时间:
[root@server1 .ssh]# gitlab-ctl reconfigure #重载服务
就可以登录了:直接修改密码
登陆上创建项目:
ssh-keygen生成
[root@server1 .ssh]# ssh-keygen
-----
[root@server1 .ssh]# ls
authorized_keys id_rsa id_rsa.pub known_hosts README.md
[root@server1 .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3UUgTea40AajYIbMy3nuWiSTgXXdo+HQTyCYgJNWjzRrbH1xyLKfZc8APdqx6s0RlIJisDBCfsSG8QnXudrtZWuurCtqkFiMxvlkC9g0RMOrarzHH7Z5tDxYmDjbNJwnO0OaOcpoWgafHypsZn2QM5yrAG73lObnyGhRoxmSAkOTFobw+KXDZwDg0M8+jXtEcTGLO3Gz1BXeCkHzONBC3Jh12SGC68cWJjqblsl4BOPlPHN0GzOfHA7+RGTmOKY3UTedW4XB1Bs9D2xP/42bi1E5NSIxK68BynTfB/pzIigBVfLAZMYVJRtzP3O/pmb9G7+ZOePJsI6kPqUkRxH7WQ== root@server1
[root@server1 .ssh]#
添加sshkey
[root@server1 demo]# git clone git@172.25.5.1:root/demo.git
Initialized empty Git repository in /root/demo/demo/.git/
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
Receiving objects: 100% (3/3), 220 bytes, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
[root@server1 demo]# ls
demo
[root@server1 demo]# cd demo/
[root@server1 demo]# ls
README.md
[root@server1 demo]# l.
. .. .git
[root@server1 demo]#
进入项目目录:
[root@server1 demo]# ls
README.md
[root@server1 demo]# git status -s
[root@server1 demo]# vim test.txt
[root@server1 demo]# git status -s
?? test.txt
[root@server1 demo]# git add test.txt
[root@server1 demo]# git status -s
A test.txt
[root@server1 demo]# git commit -m "add test"
[master d1050c9] add test
1 files changed, 4 insertions(+), 0 deletions(-)
create mode 100644 test.txt
[root@server1 demo]# git status -s
[root@server1 demo]# git push -u origin master
Counting objects: 4, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 283 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@172.25.5.1:root/demo.git
081ea22..d1050c9 master -> master
Branch master set up to track remote branch master from origin.
[root@server1 demo]#