javaweb
javaweb copied to clipboard
gitlab与github配置共存
在~/.ssh 添加config文件
github
Host github.com HostName github.com User xxx PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa.github
github: ssh-keygen -t rsa -f ~/.ssh/id_rsa.github -C "[email protected]"
gitlab: ssh-keygen -t rsa -C "[email protected]"
ssh-add ~/.ssh/id_rsa.github ssh-add ~/.ssh/id_rsa
id_rsa.github.pub里面的内容粘贴到https://github.com/settings/keys 里面 同样id_rsa.pub粘贴到gitlab的keys里面
ssh -T [email protected]
ssh -T [email protected]
在 ~/.gitconfig里面设置gitlab提交的用户名密码 [user] name = xxxx email = [email protected] [core] autocrlf = input
或者取消 git config --global --unset user.name 取消全局设置 git config --global --unset user.email 取消全局设置