安装和配置必要的依赖关系
[[email protected] ~]yum install curl policycoreutils openssh-server openssh-clients
[[email protected] ~]systemctl enable sshd
[[email protected] ~]systemctl start sshd
[[email protected] ~]yum -y install postfix
[[email protected] ~]systemctl start postfix
[[email protected] ~]systemctl enable postfix
[[email protected] ~]systemctl stop firewalld
[[email protected] ~]systemctl disable firewalld
下载gitlab源码包 https://about.gitlab.com/downloads/#centos7
[[email protected] ~]yum -y install gitlab-ce-9.1.0-ce.0.el7.x86_64.rpm
安装邮件 自动配置文件权限,安装数据库….
[[email protected] ~]gitlab-ctl reconfigure #安装时间会很长
打开浏览器输入IP访问
#生成**
[[email protected] ~]# ssh-******
#上传**
#查看**
#链接地址
命令操作
[[email protected] ~]# git config --global user.name “git” #直接在虚拟机上使用
[[email protected] ~]# git config --global user.email “[email protected]” #@后面的是本机的主机名,也可以做域名解析
[[email protected] ~]# git clone [email protected]:root/niubi.git#git clone 后面的是如下面图片上显示的你创建的机组的链接
完成上面的操作就好了,上面的操作是从gitlab下载到本地 ,下面的操作是从本地上传到gitlab
[[email protected] ~]# cd niubi.git #进入到工作目录,就是你从gitlab上下载到本地的那个目录
[[email protected] ~]# echo 12345678 > 2.sh #创建一个文件上传到gitlab上
[[email protected] ~]# git init #初始化
[[email protected] ~]# git add . #建立当前文件夹下所有的文件,为准备上传的文件
[[email protected] ~]# git commit -m ‘first commit’ # git commit 是提交上传的说明 后面的参数
[[email protected] ~]# git push -u origin master #上传命令
ok