文章目录
gitlab
1. 下载
先去清华源下载gitlab的rpm包
2. 安装配置
上传rpm包,安装
# rpm -ivh gitlab-ce-14.6.0-ce.0.el7.x86_64.rpm
如果缺少依赖包就执行
# yum install rpm包名
修改配置文件,改为本机ip
# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.44.10'
初始化(等…)
# gitlab-ctl reconfigure
otes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 # 初始密码位置
重置密码
[root@client gitlab]# gitlab-rake "gitlab:password:reset"
Enter username: root # 重置root用户密码
Enter password: 新密码(至少要8位数)
Confirm password:确认新密码
设置邮箱
等待邮箱确认
3. 开发者设置ssh密钥
第1步: 在开发者电脑上产生空密码密钥
[root@client gitlab]# ssh-keygen
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:
SHA256:03Ocv9brbo5xNOM84cPWtD219PCRiPVtP+HF+5BAFgM root@client
The key's randomart image is:
+---[RSA 2048]----+
| E.o |
| o |
| o. |
| . +o.o.o|
| S o.=..@B|
| . o oO*^|
| .+^*|
| *+B|
| o*=o|
+----[SHA256]-----
第2步: 查看并复制公钥
root@client gitlab]# cat /root/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWpjoV9iYwvq1ZRVFka6FEZRdITZVfJhZfzDTqOXqV9A23g/U9A7k85x36jk0ILjAjFqJwp9ny485CFFOBwYHa8SsF73DBewxbsN7BW8uUcwlYCm0GRZaA13fglhaMOdsKB2jh4uoSxxaGzq1d4GKpw6XO/Y2FT9RVYuSTmx3EVsNRM8oeH3fWOhhJZCcDjtliFeP1hIM/gPkEAGyZmar9pfAhr/QNyUiHI+6OuQUU13xOR6JQdPT4oMqrLb6yugC8T5IowtzxVghaIv47Ogf40fJHTqnmhJCYzDTAciOvUzMMSMfj5IyFVc9mN1RJi+ENzhtYe4FMEaksOUFKPJDZ root@client
第3步: 在gitlab界面添加公钥
4. gitlab创建仓库
第1步: 在gitlab上创建项目
第2步: 自定义项目名称,描述等
第3步: 验证创建好的项目
5. 克隆远程仓库到本地
第一步:安装git
# yum install git -y
第二步:在电脑上设置身份标识
# git config --global user.name "root"
# git config --global user.email "[email protected]"
第三步: 在开发者电脑上使用git命令clone,并上传代码
# git clone http://192.168.44.10/root/test.git
# echo "测试代码上传" >> READMW.md
# git add *
# git commit -m "这是一个测试"
# git push
Username for 'http://192.168.44.10': root # gitlab用户名
Password for 'http://[email protected]': # 密码
版权归原作者 爱敲代码的三毛 所有, 如有侵权,请联系我们删除。