git
Posted panqingpeng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git相关的知识,希望对你有一定的参考价值。
gitlab的安装与部署
部署环境 centos7.5
一. 安装依赖
[[email protected] ~]# systemctl stop/disable/mask firewalld #中间三个参数都执行一遍
[[email protected] ~]# yum install curl openssh-server openssh-clients postfix cronie
[[email protected] ~]# yum -y install policycoreutils-python iptables iptables-services
[[email protected] ~]# systemctl start postfix #GitLab使用postfix发送邮件
Starting postfix: [ OK ]
[[email protected] ~]# systemclt enable postfix #设置postfix开机自启动
[[email protected] ~]# lokkit -s http -s ssh #配置iptables开放http和ssh端口,这里需要注意,腾讯云安全组选择那里要选择开放所有端口这一步可能会显示failed ip6tables start,这个不需要管,直接运行下面查看是否打开端口就可以了
[[email protected] ~]# iptables -L #输入命令查看是否打开http和ssh端口
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEWtcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEWtcp dpt:http #如显示上面的界面则表示已经打开端口
二.安装gitlab
rpm包下载地址 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
[[email protected] ~]# rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
[[email protected] ~]# vim /etc/gitlab/gitlab.rb
external_url ‘http://192.168.157.36‘ #将外部URL这行修改为gitlab服务器的IP地址
[[email protected] ~]# cat -n /etc/gitlab/gitlab.rb |grep -w "13"
13 external_url ‘http://192.168.157.36‘
[[email protected] ~]# gitlab-ctl reconfigure #配置gitlab,时间稍微有点长,大概1分钟,这步也是启动gitla
- gitlab的默认监听端口是8080,jenkins的监听端口也是8080
三.登陆gitlab
- 在浏览器输入gitlab主机IP地址即可访问GIT,第一次登陆的时候,需要初始化大量的东西,经常会出现502错误,通常是由于内存不足的原因导致,官方推荐生产环境中使用2G内存,2核CUP。虚拟机中测试1GB内存基本就可以了。
- 首次登陆默认进入修改密码页面,而且至少8位,这里我将密码修改为0000
跳转到注册和登陆页面我们先注册一下 , 我注册的name : rebareba password: zixi.519
四.gitlab的简单使用
1.创建一个gitlab项目
创建组
五.在windows上安装git客户端
下载地址 https://git-scm.com/downloads
以上是关于git的主要内容,如果未能解决你的问题,请参考以下文章