gitlab官网 https://about.gitlab.com/gitlab-com/ 官方安装文档 https://about.gitlab.com/installation/?version=ce#centos-7 (ce/ee) 要求服务器内存很多于2g vim /etc/yum.repos.d/gitlab.repo//加入以下内容 [gitlab-ce] name=Gitlab CE Repository baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ gpgcheck=0 enabled=1 yum install -y gitlab-ce gitlab-ctl reconfigure netstat -lnpt //查看监听端口 gitlab-ctl stop/restart/start/status 浏览器访问gitlab,输入ip便可 默认管理员root,无密码,它会让咱们去定义一个密码
运行命令 yum install --downloadonly --downloaddir=/tmp/git gitlab-ce 会有不少.rpm包在该文件夹 rpm -Uvh * gitlab-ctl reconfigure 若是遇到报错 ruby_block[supervise_redis_sleep] action run,会一直卡没法往下进行 一、按住CTRL+C强制结束; 二、运行:sudo systemctl restart gitlab-runsvdir; 三、再次执行:sudo gitlab-ctl reconfigure 若是缺乏依赖包,则去rpm网站下载,用rpm -qa 去正常环境中找
git clone http://gitlab.xxxx/xxx.git 输入邮箱帐号及密码
删除文件夹中的.git文件夹,打包压缩python
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
登录gitlab -->设置默认密码为"12345678"--> 右上角图标 --> settings --> SSH Keys --> 将id_rsa.pub的内容粘贴上git
登录Gitlab --> 点击Projects --> New project --> 在project name 中填写 itmonitor --> 选择Public -->建立redis
参考刚刚建立出来的建立项目后指引"Push an existing folder" 修改服务器/etc/hosts 10.0.0.x gitlab.example.comvim
git config --global user.name "Administrator" git config --global user.email "admin@example.com" cd existing_folder git init git remote add origin git@gitlab.example.com:root/test.git git add . git commit -m "Initial commit" git push -u origin master
要求git客户端须要和gitlab的端口能通(80,22)centos
若是没有git命令,则须要安装git yum install -y git 或者在有网的环境下载git安装包 yum install --downloadonly --downloaddir=/tmp/ git