电脑环境:centos6.2+gitlab10.0
gitlab10.0 (gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm)下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/
步骤1:配置系统防火墙,把HTTP和SSH端口开放
sudo yum install curl openssh-server postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
步骤2:开始安装
sudo rpm -ivh gitlab-ce-10.0.0-ce.0.el6.x86_64.rpm
步骤3:保存配置
sudo gitlab-ctl reconfigure
步骤4:启动
sudo gitlab-ctl start
安装过程中遇到的错误:502错误(排除端口冲突,在网上看到好多是因为端口冲突引起的),解决方法
/opt/gitlab/embedded/bin/gitlab-workhorse -listenNetwork unix -listenUmask 0 -listenAddr /var/opt/gitlab/gitlab-workhorse/socket -authBackend http://localhost:8080 -authSocket /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket -documentRoot /opt/gitlab/embedded/service/gitlab-rails/public -pprofListenAddr
gitlab-ctl restart
一些常用命令:
Git 全局设置
git config --global user.name "****" git config --global user.email "*****@163.com"
创建新版本库
git clone http://192.168.1.10/lvlv/TestGit.git cd TestGit touch README.md git add README.md git commit -m "add README" git push -u origin master
已存在的文件夹
cd existing_folder git init git remote add origin http://192.168.1.10/lvlv/TestGit.git git add . git commit -m "Initial commit" git push -u origin master
已存在的 Git 版本库
cd existing_repo git remote add origin http://192.168.1.10/lvlv/TestGit.git git push -u origin --all git push -u origin --tags
解决git本地仓库与远程仓库关联出现 failed to push some refs to git的问题
git pull --rebase origin master
git push -u origin master
atal: parameter inet_interfaces: no local interface found for 127.0.0.1
发现配置为:
inet_interfaces = localhost
inet_protocols = all
改成:
inet_interfaces = all
inet_protocols = all
重新启动就ok了
service postfix start