一.设置公司gitlab密钥对(全局配置)
- 设置一个全局账号
git config --global user.name <yourname>
git config --global user.email <[email protected]>
- 用公司邮箱生成秘钥(默认生成id_rsa、id_rsa.pub)
ssh-keygen -t rsa -C "[email protected]"
输入命令后一直回车(密码可以不填),至此 gitlab 用的密钥对就生成了, 在 ~/.ssh 文件夹下。
- 把公钥id_rsa.pub里面的内容填入gitlab的SSH Keys
切换到~/.ssh,命令行显示id_rsa.pub内容
cd ~/.ssh