git + gitlab + github的关联

2023-06-07  本文已影响0人  贺贺v5

当新拿到一台Mac后,需要重新配置好多环境,今天就来记录一下如何配置git+gitlab(公司自己的私有仓库)+github的环境,使得git clone git@gitlab.100credit.cn:bairong/rule-config.git可是正常下载。

  1. 配置git环境
  1. 生成公钥和私钥
  1. 将公钥拷贝到gitlab和github的SSH keys中


    image.png
  1. 将私钥配进/Users/hehe/.ssh/config文件中
Host gitlab.100credit.cn
HostName gitlab.100credit.cn
Port 3222
User heyingchun
IdentityFile ~/.ssh/id_rsa

如果总是报错:Bad owner or permissions on /Users/hehe/.ssh/config
那么在.ssh目录下这样执行一下:sudo chmod 600 config

上一篇 下一篇

猜你喜欢

热点阅读