🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
![](https://box.kancloud.cn/db10afcaabff70b93810ac7ba8eea28c_1568x507.png) 二)新建组 ![](https://box.kancloud.cn/ec011a9a819094779c5cb0d21c1a9c19_1408x796.png) 三)新建用户 ![](https://box.kancloud.cn/d256d441562ea1dd0a951c590392d682_1558x695.png) ![](https://box.kancloud.cn/980b537446117cb0e8473ec7fc00bf94_1308x722.png) 给刚刚注册的用户,设置密码 ![](https://box.kancloud.cn/436bd3053a8ca89a0eefde01b027839f_1597x444.png) ![](https://box.kancloud.cn/e9c7dda6831ff3a964330dd43391d450_1552x285.png) 将用户加入到指定组 ![](https://box.kancloud.cn/77063e0187552268861b618aab17d5ac_1556x614.png) 四)新建项目 更改域名 [root@server01 gitlab]# vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml # This file is managed by gitlab-ctl. Manual changes will be # erased! To change the contents below, edit /etc/gitlab/gitlab.rb # and run `sudo gitlab-ctl reconfigure`. production: &base # # This file is managed by gitlab-ctl. Manual changes will be # erased! To change the contents below, edit /etc/gitlab/gitlab.rb # and run `sudo gitlab-ctl reconfigure`. production: &base # # 1. GitLab app settings # ========================== ## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: git.pet.com port: 80 https: false [root@server01 gitlab]# gitlab-ctl reconfigure [root@server01 gitlab]# gitlab-ctl restart ![](https://box.kancloud.cn/ca74ce279a7c36e049bc08baf872d473_1555x384.png) ![](https://box.kancloud.cn/ef8e99bd98e281be89783d01bfa1c7b9_1292x638.png) 第二部分:客户端操作 添加key密钥到gitlab服务器 [root@proxy01 ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 7f:81:b9:df:32:d5:4f:00:98:3b:ca:f1:5c:fa:2a:4f root@proxy01 The key's randomart image is: +--[ RSA 2048]----+ | o | | o . | | . . | | . oo. . | | .S=o+. o | | o.+. .. o| | E... ..| | .. o+. .| | oo..o. | +-----------------+ [root@proxy01 ~]# cat .ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA8omQ0y3qbH7BNHskbdSgvFqurmHgGJDcvxI69X0pl9U+TQ69XkbzhfAceUFZwrL/D0/ON9nSeqzfzgaPpgPxmaCyKtJ+pMdRjZVwZa5dwl7IobUkpHlSJDkOyvVuOIvmR2Mha8XJyzA0yBOI+to1qHNdKx++Ihu2PWwN/+x0ZufBjgigDuLD/ILIypGxSN53doxqlk4SiwHwtiQhC7rOqXhzivtmV3Vjz4dQqo9s4mOqYWWnpoGb86phTFeuipHAyNmsYoWucWyDBroV7MnxHkLiBAPqFFR5W6lWu6CbRLq9Ii3FG+G/cLVztMpZ/EheubUsU1F3R2v1RT2mqjrMZQ== root@proxy01 ![](https://box.kancloud.cn/f05aac6af6304969a49679ab4f52419a_1059x579.png) [root@proxy01 ~]# yum -y install git 客户端测试获取git仓库 [root@proxy01 ~]# git clone git@git.pet.com:pet_dev/new_pet.git Initialized empty Git repository in /root/new_pet/.git/ The authenticity of host 'git.pet.com (10.100.100.104)' can't be established. RSA key fingerprint is dd:b4:7e:56:49:2a:69:40:ab:c3:2d:60:c3:26:00:65. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'git.pet.com,10.100.100.104' (RSA) to the list of known hosts. warning: You appear to have cloned an empty repository. [root@proxy01 ~]# git config --global user.name "xionghaihua" [root@proxy01 ~]# git config --global user.email "xionghaihua@91als.com.cn" [root@proxy01 ~]# cd new_pet/ [root@proxy01 new_pet]# touch README.md [root@proxy01 new_pet]# git add . [root@proxy01 new_pet]# git commit . -m "add README" [master (root-commit) e596cf3] add README 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md [root@proxy01 new_pet]# git push -u origin master Counting objects: 3, done. Writing objects: 100% (3/3), 217 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@git.pet.com:pet_dev/new_pet.git * [new branch] master -> master Branch master set up to track remote branch master from origin.