Git详解及 GitHub与GitLab使用(8)

[root@gitlab ~]# gitlab-ctl status run: gitaly: (pid 4491) 48s; run: log: (pid 4087) 279s run: gitlab-monitor: (pid 4539) 44s; run: log: (pid 4251) 207s run: gitlab-workhorse: (pid 4501) 47s; run: log: (pid 4099) 273s run: logrotate: (pid 4125) 265s; run: log: (pid 4124) 265s run: nginx: (pid 4112) 271s; run: log: (pid 4111) 271s run: node-exporter: (pid 4175) 243s; run: log: (pid 4174) 243s run: postgres-exporter: (pid 4528) 45s; run: log: (pid 4223) 219s run: postgresql: (pid 3933) 343s; run: log: (pid 3932) 343s run: prometheus: (pid 4514) 46s; run: log: (pid 4156) 259s run: redis: (pid 3876) 355s; run: log: (pid 3875) 355s run: redis-exporter: (pid 4186) 237s; run: log: (pid 4185) 237s run: sidekiq: (pid 4078) 281s; run: log: (pid 4077) 281s run: unicorn: (pid 4047) 287s; run: log: (pid 4046) 287s

检查端口

[root@gitlab ~]# netstat -lntup|grep 80 tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 4073/unicorn master tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4112/nginx: master tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 4112/nginx: master

1.9.2 使用浏览器访问,进行web界面操作

第一次访问,创建密码

Git详解及 GitHub与GitLab使用

进行登陆,用户名为root,密码为12345678

Git详解及 GitHub与GitLab使用

创建一个新的项目

Git详解及 GitHub与GitLab使用

定义项目的名称

Git详解及 GitHub与GitLab使用

创建完成后会提示没有添加ssh密钥

Git详解及 GitHub与GitLab使用

在服务器上创建ssh密钥 使用ssh-ketgen 命令

[root@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:n/V2kCiwwm2UfBsnQLm17eXUCBiBByyPbefmz5oQvfU root@gitlab The key's randomart image is: +---[RSA 2048]----+ | o++o+ | | ..+o+ . | | ==++o.. o | | ..o==o=..+..| | o.So+.++o | | o oo*.o.. | | .o+ E .| | ..o . . | | ooo | +----[SHA256]-----+

 

[root@gitlab .ssh]# cat id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSVdBypha/ALMmvIiZGXxYGz7FJ5TC+hYWo7QGBJ+J6JVinp9yH851fwxln5TWGBrtEousoVHXTTJfFRy8LV+Ho7OfaksYt+5TPxEjf5XX53Z3ZX70PYH3DQFmgzl0QpWw1PYIjrD7kBeLhUg+R/ZePS+HzPvbRCb6gOlkdx46vX4Olr7YbAO5lzAarhaZcE2Q702kPXGeuZbR7KcwVhtoiueyHwyj94bccMfKq7qSskXGbpWuCwcaKQ6uqGap1rP5Viqqv0xeO7Vq0dIZ/YnPL2vPDUvNa36nHosiZGkn4thpPh63KjXaFIfKOuPemLzvDZY0A+88P8gwmAYiPoxp root@gitlab

将密钥添加到web界面的用户中

Git详解及 GitHub与GitLab使用

gitlab自带的命令集

Command line instructions Git global setup git config --global user.name "Administrator" git config --global user.email "admin@example.com" Create a new repository git clone git@gitlab.example.com:root/clsn.git cd clsn 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 git@gitlab.example.com:root/clsn.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 git@gitlab.example.com:root/clsn.git git push -u origin --all git push -u origin --tags

创建行的git仓库

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/13103.html