首页 > 移动平台 > 详细

13.gitlab搭建仓库及联通Jenkins

时间:2021-09-05 15:58:20      阅读:19      评论:0      收藏:0      [点我收藏+]

gitlab搭建仓库及联通Jenkins

gitlab创建仓库

技术分享图片

Create blank project
技术分享图片

仓库创建成功,有提示参考信息
技术分享图片

gitlab配置SSH

技术分享图片

git@192.168.222.128:root/gitlab_combat.git
git@gitee.com:gavinxiexingfu/test_combat.git

git remote rm origin

git remote -v

git关联多个仓库

git remote add gitlab git@192.168.222.128:9001/root/gitlab_combat.git
git remote add gitee git@gitee.com:gavinxiexingfu/test_combat.git

git push gitee master
git push gitlab master

git remote rm gitee
git remote rm gitlab

git remote add gitlab http://192.168.222.128:9001/root/gitlab_combat.git

git使用ssh推送到gitlab需要输入密码解决

使用ssh推送代码到gitlab报错:需要输入密码,不管输入什么都报错

$ git push gitlab master
git@192.168.222.128‘s password:
Permission denied, please try again.
git@192.168.222.128‘s password:
Permission denied, please try again.
git@192.168.222.128‘s password:
git@192.168.222.128: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决:Linux系统里面修改
修改gitlab的端口
文件:/etc/gitlab/gitlab.rb
修改
gitlab_rails[‘gitlab_shell_ssh_port‘] = 8002

重新启动容器,启动成功,重新关联仓库
仓库地址自动带上ssh端口号
ssh://git@192.168.222.128:8022/root/gitlab_combat.git

gavin@LAPTOP-GPDG2OBO MINGW64 /d/py project/Merchants_combat/day6 (master)

 git remote add gitlab ssh://git@192.168.222.128:8022/root/gitlab_combat.git

$ git remote -v
gitee   git@gitee.com:gavinxiexingfu/test_combat.git (fetch)
gitee   git@gitee.com:gavinxiexingfu/test_combat.git (push)
gitlab  ssh://git@192.168.222.128:8022/root/gitlab_combat.git (fetch)
gitlab  ssh://git@192.168.222.128:8022/root/gitlab_combat.git (push)

gavin@LAPTOP-GPDG2OBO MINGW64 /d/py project/Merchants_combat/day6 (master)
$ git push gitlab master
The authenticity of host ‘[192.168.222.128]:8022 ([192.168.222.128]:8022)‘ can‘t be established.
ECDSA key fingerprint is SHA256:Sq2//h6bepjalAUiqUUJlqcKcmJ2llQ2Bz6euw9f39E.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘[192.168.222.128]:8022‘ (ECDSA) to the list of known hosts.
Everything up-to-date

参考资料:
https://www.it610.com/article/1281977795542532096.htm

13.gitlab搭建仓库及联通Jenkins

原文:https://www.cnblogs.com/xiehuangzhijia/p/15225851.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!