1.上传项目正确姿势
- cd xmspace
- git init
- git remote add origin http://git.xmspace.net/crx349/xmspace.git
- git add .
- git commit -m "init files"
- git push -u origin master
复制代码
2.修改gitlab为绑定域名
打开
- vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
复制代码
修改 host为域名
- ## GitLab settings
- gitlab:
- ## Web server settings (note: host is the FQDN, do not include http://)
- host: git.xmspace.net
- port: 8099
- https: false
复制代码
重启gitlab
报错:git operation was rejected by pre-receive hook
/opt/gitlab/embedded/service/gitlab-shell/config.yml
搜索:
- gitlab_url: "http://127.0.0.1:8098"
复制代码
改为
- gitlab_url: "http://git.xmspace.net"
复制代码
重启gitlab
换项目存储目录
- vi /etc/gitlab/gitlab.rb
- # 把注释取消然后指定新的仓库存储位置
- git_data_dirs({ "default" => { "path" => "/www/gitlab-data" } })
复制代码
没数据的情况下:
- gitlab-ctl stop
- gitlab-ctl reconfigure
复制代码
有数据的情况:
- rsync -av /var/opt/gitlab/git-data/repositories /www/gitlab-data/
复制代码
# 注意 'repositories'后面不带斜杠,而
# '/www/gitlab-data'后面是有斜杠的。
修复
启动gitlab |