git、github和gitlab的區別
git:是一種版本控制系統,是一個命令,是一種工具
gitlib:是基于實作功能的開發庫
github:是一個基于git實作的在線代碼倉庫軟體
gitlib可以搭建一個類似于github一樣的系統,一般用于企業或者學校等內部網路搭建私服,gitlab免費支持私人倉庫,而github需要收費,如果公司團隊開發的代碼不想托管到github收費平臺,就可以選擇搭建公司gitlab服務,
搭建gitlab
安裝ssh
sudo yum install -y curl policycoreutils-pythonopenssh-server
ssh服務設定開機自啟動
sudo systemctl enable sshd
啟動ssh服務
sudo systemctl start sshd
安裝防火墻(如果已經安裝了防火墻并且已經在運行狀態,則可直接進行第6步)
yum install firewalld systemd -y
開啟防火墻
service firewalld start
添加http服務到firewalld,pemmanent表示永久生效,若不加--permanent系統下次啟動后就會失效,
sudo firewall-cmd --permanent --add-service=http
重啟防火墻
sudo systemctl reload firewalld
安裝Postfix以發送通知郵件
sudo yum install postfix
postfix服務設定開機啟動
sudo systemctl enable postfix
啟動postfix
sudo systemctl start postfix
如果centos7沒有安裝wget,則安裝wget命令
yum -y install wget
下載gitlab鏡像
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
安裝gitlab
rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

如果出現了改圖,則安裝成功
修改gitlab組態檔指定服務器ip
vim /etc/gitlab/gitlab.rb
修改external_url 'http://localhost',把localhost改成搭建gitlab的服務器ip地址
重置組態檔
gitlab-ctl reconfigure
重啟gitlab
gitlab-ctl restart
gitlab創建專案
訪問gitlab頁面
直接在瀏覽器輸入ip訪問
第一次進入直接點修改密碼

創建用戶,點擊New User

點擊New group創建組

創建專案


轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/2451.html
標籤:其他
上一篇:SVN服務器和客戶端的下載和安裝
