本来花了些时间安装git和gitolite,但是它没有界面,而且权限管理每次都要传pub,配置文件,不方便直观使用,便直接安装gitlab版本,这样使用更加方便,也便于直观的管理,当然最重要的是界面很炫不是么。
ERRO:
fatal: parameter inet_ http://blog.csdn.net/xiangshanqishi/article/details/23439397
解决办法为 vi /etc/postfix/main.cf 发现配置为:
inet_interfaces = localhost inet_protocols = all改成:
inet_interfaces = all inet_protocols = all国外镜像下载太慢,官网的安装方式不适合 直接下载清华镜像上的最新版本的rpm https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/ 安装该版本 rpm -i gitlab-ce-XXX.rpm
自GitLab 7.6开始的新安装包, 已经默认将所有的参数写入到 /etc/gitlab/gitlab.rb 文件中. vim /etc/gitlab/gitlab.rb
external_url ‘http://gitlabServer’ 修改为 external_url ‘http://localhost:90’
unicorn[‘listen’] = ‘127.0.0.1’ unicorn[‘port’] = 9080
重新生成gitlab sudo gitlab-ctl reconfigure
http://ip:90 开始会让你root登陆然后设置新密码
在GitLab上新建一个项目test_gitlab,刚开始仓库地址是http://localhost/yulei/test_gitlab.git .
vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml修改gitlab下host值为实际的域名或服务器IP地址即可,保存退出
重启GitLab gitlab-ctl restart
注意:这种方法只是暂时性的,如果你sudo gitlab-ctl reconfigure 之后还是会遇到这个问题,根本解决办法如下
这里的host和port都是根据/etc/gitlab/gitlab.rb 中的external_url的值取的host和port,因此修改gitlab.rb中的external_url external_url “http://119.1001.11.1:90” 然后 sudo gitlab-ctl reconfigure 才是根本解决办法
系统盘容量太小,创建新地址:
mkdir -p /mnt/opt/gitlab/git-data [root@gitlabServer gitlab-rails]# mkdir -r /mnt/opt/gitlab/git-data # git_data_dirs({ "default" => { "path" => "/var/opt/gitlab/git-data", 'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket' } }) git_data_dirs({ "default" => { "path" => "/mnt/opt/gitlab/git-data", 'gitaly_address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket' } })重新生成gitlab sudo gitlab-ctl reconfigure
一、停止gitlab sudo gitlab-ctl stop 二、卸载gitlab sudo rpm -e gitlab-ce 三、查看gitlab进程 ps -ef |grep gitlab 杀掉第一个守护进程 kill -9 4473 再次查看gitlab进程是否存在 四、删除gitlab文件 find / -name gitlab|xargs rm -rf 删除所有包含gitlab的文件及目录 删除gitlab-ctl uninstall时自动在root下备份的配置文件
此时会一直阻塞到这里,解决办法如下: CTRL+C 结束当前进程
#sudo systemctl restart gitlab-runsvdir #再次启动配置 #sudo gitlab-ctl reconfigure此解决方法原文出自: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/160
git@localhost:test/test.git 私有仓库的地址居然是localhost,不是本机的IP地址 vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml 修改gitlab下host值为实际的域名或服务器IP地址即可,保存退出
production: &base # # 1. GitLab app settings # ========================== ## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: 192.190.116.10 #改成你自己的IP port: 90 #改成你自己配置的端口默认情况下,GitLab会将数据库文件放在 /var/opt/gitlab/postgresql/data 中。 如果要修改数据库文件位置,需要将 /var/opt/gitlab/postgresql/data 中的所有文件复制到新的位置,然后在 /etc/gitlab/gitlab.rb 中设置以下4个配置至新的位置:
# postgresql['dir'] = "/var/opt/gitlab/postgresql" # postgresql['data_dir'] = "/var/opt/gitlab/postgresql/data" # postgresql['log_directory'] = "/var/log/gitlab/postgresql" # postgresql['home'] = "/var/opt/gitlab/postgresql" postgresql['dir'] = "/mnt/opt/gitlab/postgresql" postgresql['data_dir'] = "/mnt/opt/gitlab/postgresql/data" postgresql['log_directory'] = "/mnt/opt/gitlab/postgresql/log" postgresql['home'] = "/mnt/opt/gitlab/postgresql" mkdir -p /mnt/opt/gitlab/postgresql/data mkdir -p /mnt/opt/gitlab/postgresql/log chown -R gitlab-psql /mnt/opt/gitlab/postgresql保存退出,并执行完成 sudo gitlab-ctl reconfigure
git客户端报错: remote: GitLab: You are not allowed to push code to protected branches on this project. 项目所属者点击项目点击settting,下图中Allowed to push下拉选择”Master+Developers”即可,它会自动保存设置
以163邮箱为例 打开/etc/gitlab/gitlab.rb文件,将以下设置添加到文件中,保存。
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = “smtp.163.com” gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = “zjcjava@163.com“ gitlab_rails['smtp_password'] = "smtp password" gitlab_rails['smtp_authentication']= “login" gitlab_rails['smtp_enable_starttls_auto']= true gitlab_rails['gitlab_email_from']= 'zjcjava@163.com' gitlab_rails['gitlab_email_reply_to']= ‘zjcjava@163.com'https://www.gitlab.com.cn/downloads/#centos7 https://docs.gitlab.com.cn/omnibus/settings/configuration.html