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里面便可