git服務器簡單對比:
gitblit:簡單易用
gitlab:功能全面
gitblit
地址: http://gitblit.com
下載Gitblit Go,並且修改data/gitblit.properties文件,重寫以下配置信息(這些
參數在data/defaults.properties有):
git.repositoriesFolder:git倉庫地址,如果對路徑無特殊要求,也可不更改
server.httpPort:http協議的端口號。
server.httpsPort:https協議的端口號,如不需要可以不更改。
server.httpBindInterface:http服務器的IP地址
server.httpsBindInterface:https服務器的IP地址,如不需要可以不更改.
保存文件,運行gitblit.sh,可以通過瀏覽器訪問: http://192.168.1.6:8000,用
默認用戶名及密碼登錄即可以,默認admin/admin
gitlab
地址: https://about.gitlab.com/
centos 7
下安裝如下:
一. 安裝所需依賴
1.sudo yum install curl policycoreutils openssh-server openssh-clients
2. sudo systemctl enable sshd
3. sudo systemctl start sshd
4. sudo yum install postfix
5. sudo systemctl enable postfix
6. sudo systemctl start postfix
7. sudo firewall-cmd --permanent --add-service=http
8. sudo systemctl reload firewalld
二、
增加gitlib鏡像源,以下使用的是清華大學的鏡像源,地址如
下: https://mirror.tuna.tsinghua.edu.cn/
[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
執行以下:
sudo yum makecache
sudo yum install gitlab-ce
配置並啓動gitlab:
sudo gitlab-ctl reconfigure
瀏覽器直接輸入機器ip即可,其默認是80端口。第一次會讓修改密碼,其默認用戶名
爲root。
gitlab的操作可以通過gitlab-ctl進行操作,其主要有以下參數:
deploy-page
但如果要進行服務的啓動什麼的,直接關閉是無效的,必須通過以下方法關閉相應服務纔可
以,其服務名稱爲gitlab-runsvdir.service:
systemctl disable gitlab-runsvdir
2. systemctl enable gitlab-runsvdir
3. systemctl start gitlab-runsvdir
4. systemctl stop gitlab-runsvdir
5. systemctl status gitlab-runsvdir