gitlab安装与部署

gitlab常用命令
gitlab-ctl start # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
gitlab-ctl reconfigure # 启动服务;
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
gitlab-ctl tail # 查看日志;


Gitlab
私有仓库

GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务。

可通过Web界面进行访问公开的或者私人项目。它拥有与Github类似的功能,能够浏览源代码,
管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。
团队成员可以利用内置的简单聊天程序(Wall)进行交流。
它还提供一个代码片段收集功能可以轻松实现代码复用。


gitlab

公共的代码仓库


gitlab安装:
rz
第一步:安装gitlab
[root@ken1 ~]# yum localinstall gitlab-ce-8.9.5-ce.0.el7.x86_64.rpm -y

第二步:修给配置文件
vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.126.6'

第三步:生效配置文件内存必须大的
gitlab-ctl reconfigure


第四步:访问
192.168.126.6

 


 

 

 

 

 

 

 

 

 

 

 

 

创建一个更目录
mkdir /zxw
[root@zxw6 ~]# cd /zxw
[root@zxw6 zxw]# pwd
/zxw
[root@zxw6 zxw]# ls
克隆到本地目录
[root@zxw6 zxw]# git clone http://192.168.126.6/root/zxw.git
Cloning into 'zxw'...
warning: You appear to have cloned an empty repository.
[root@zxw6 zxw]# ls
zxw
[root@zxw6 zxw]# cd zxw
[root@zxw6 zxw]# ls
[root@zxw6 zxw]# ls -a
. .. .git
创建一个版本
[root@zxw6 zxw]# touch z.txt
[root@zxw6 zxw]# ls
z.txt
提交到暂存
[root@zxw6 zxw]# git add .
提交到仓库
[root@zxw6 zxw]# git commit -m "v1"

 


[root@zxw6 zxw]# ls
z.txt

查看分支
[root@zxw6 zxw]# git branch
* master
把本地内容推送到主节点
[root@zxw6 zxw]# git push -u origin master
Username for 'http://192.168.126.6': root
Password for 'http://root@192.168.126.6':
Counting objects: 3, done.
Writing objects: 100% (3/3), 200 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://192.168.126.6/root/zxw.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.

原文地址:https://www.cnblogs.com/itzhao/p/11301128.html