1、在centos環境下搭建gitlabhtml
一、在centos服務器中執行如下命令,進行安裝前準備git
yum -y install curl policycoreutils openssh-server openssh-clients systemctl enable sshd systemctl start sshd yum install postfix systemctl enable postfix systemctl start postfix firewall-cmd --permanent --add-service=http systemctl reload firewalld
二、將gitlab安裝包(在此頁面上選擇合適的安裝包下載 https://packages.gitlab.com/gitlab/gitlab-ce)上傳到centos服務器後執行安裝命令github
rpm -i gitlab-ce-8.1.0-ce.0.el7.x86_64.rpm
三、修改gitlab配置,並重啓windows
vi /etc/gitlab/gitlab.rb #按需進行修改 sudo gitlab-ctl reconfigure
四、用瀏覽器打開服務器的端口,會出現如下頁面,默認的會存在root賬號,其初始密碼爲:5iveL!fecentos
#http://www.cnblogs.com/juandx/p/5339254.html瀏覽器
五、使用root登陸後可在在gitlab用戶界面中右上角,找到小扳手進入管理員界面添加用戶bash
2、windows環境下git的搭建服務器
一、下載git-bash並安裝,全默認安裝便可ssh
二、默置git免密碼登陸curl
2.1 在gitlab中配置好賬號
2.2 在windows環境中打開git-bash,執行如下命令,以配置指定賬號
git config --global user.name "lxyz" git config --global user.email "z11291dd@qq.com" ssh-keygen -t rsa -C 「z11291dd@qq.com」
執行完命令要求輸入時就回車,而後後提 示生成了密鑰文件,而後到用戶目錄的.ssh下面將id_rsa.pub裏的內容複製出來粘貼到github我的中心的帳戶設置的ssh key裏面便可