GitLab搭建和使用

   演员表: 胖八毛(程序员) 小公举(测试软妹子) 八哥(bug)


GitLab搭建和使用

目录

搭建gitLab服务器

1.1通过官网安装

1.2建立一个组和项目

1.3生成ssh key

1.4learn more about protected branches

1.5 新建用户,设置权限

1.6 新建设置保护分支

1.7 gitlab关闭用户注册功能


GitLab搭建和使用
胖八毛
GitLab搭建和使用

GitLab搭建和使用

通过官网安装

    访问https://about.gitlab.com/installation/选择对应的服务器,根据提示安装

然后建立一个组和项目

    if you already have files you can push them using command line instructions

生成ssh key

    ssh‐****** ‐t rsa ‐C [email protected] ‐b 4096


    Git global setup

git config ‐‐global user.name "Administrator"

git config ‐‐global user.email "[email protected]"


    create a new reponsitory

git clone http://192.168.0.107/test/test‐project.git

cd test‐project

touch README.md

git add README.md

git commit ‐m "add README"

git push ‐u origin master


    Existing folder

cd existing_folder

git init

git remote add origin http://192.168.0.107/test/test‐project.git

git add .

git commit ‐m "Initial commit"

git push ‐u origin master


    Existing Git repository

cd existing_repo

git remote rename origin old‐origin

git remote add origin http://192.168.0.107/test/test‐project.git

git push ‐u origin ‐‐all

git push ‐u origin ‐‐tags


learn more about protected branches

注意这里的host要修改为你站点的host

http://192.168.0.108/help/user/project/protected_branches

enable Auto DevOps (Beta):http://192.168.0.108/test/test-project/settings/ci_cd#autodevops-settings


新建用户,设置权限

新建设置保护分支

直接在gitlab内操作即可

gitlab关闭用户注册功能

去掉Sign-up enabled的对勾

Admin‐‐>settings ‐‐> Sign‐up Restrictions

Sign‐upenbaled 关闭注册功能

gitlab配置

修改gitlab的host,将external_url修改为对应的域名或ip

vim /etc/gitlab/gitlab.rb

重新配置

gitlab-ctl reconfigure

修改访问的端口,将listen对应的端口修改成需要的

cd /var/opt/gitlab/nginx/conf
vim gitlab-http.conf

重启gitlab服务

gitlab-ctl restart
GitLab搭建和使用


     聪明的你GitLab搭建和使用知道如何帮我们的小公举处理这个问题吗?

     大家可以在留言评论或者公众号中回复你的答案,我们会在所有留言和评论中选出真正的那个胖八毛,在下期公布……敬请期待!

GitLab搭建和使用

     你也可以把你工作中遇到的问题和bug在公众号中发送给我,我将会给予处理建议。并会抽取一些代表性的,在公众号中给大家以胖八毛的形式给大家解答……GitLab搭建和使用

               


相关文章: