版本控制的概念
记录开发文件的时间机器,可以挽回因为错误导致的损失
分类
本地版本控制系统
集中化的版本控制系统cvs. Subversion (sVN)
分布式版本控制系统GIT
Gitlab部署
官网链接 https:/labout.gitlab.com/downloads/#centos7
1.Install and configure the necessary dependencies
4G以上内存
yum install curl policycoreutils openssh-server openssh-clientssudo
systemctl enable sshd
systemctl start sshd
yum install postfix
systemctl enable postfix
systemctl start postfix
systemctl stop firewalld
systemctl disable firewalld
2.Add the GitLab package server and install the packa
yum -y install gitlab-ce-9.1.0-ce.0.el7.x86_64.rpm
3.Configure and start atLabo
gitlab-ctl reconfigure
4.Browse to the hostname and login
gitlab服务器的地址: http://IP:80
创建8位新密码
然后使用root登录即可
创建项目需要进行免密操作
1秘钥提示
复制项目的地址,并保存
2查看秘钥
ssh-keygen
3上传秘钥
cat .ssh/id_pub
在网址的setting中找到SSH Keys上传密码
4查看秘钥
5链接地址
6使用gitlab
命令行操作
1.域名解析
vim /etc/hosts
192.168.2.133 gitlab.example.com
⒉克隆服务器的文件
git config --global user.name "用户名"
git config --global user.email "用户名@服务器名(IP)"
git clone 项目地址(ssh格式)
3.上传文件
git init
git remote add origin 项目地址(ssh格式)
git add 工作目录(这个目录会被上传)
git commit
git push -u origin master