RT,我想在我本地设置多个git账户,同时应对gitlab/github的工作。
我按照搜索的教程来做了,可以push到github远端了,虽然名字跟我设置的对的上,但是github commit log上的名字却无法对应上我的账户,也就是名字上没有链接。请问是我哪里姿势不对?
Host github.com
HostName github.com
User gitname
PreferredAuthentications publickey
IdentityFile /Users/xx/.ssh/id_rsa_github
Host gitlab.com
HostName gitlab
User git
PreferredAuthentications publickey
IdentityFile /Users/xx/.ssh/id_rsa
我有首先unset全局设置,然后本地设置,名字跟github账户的名字对的上,但是push上去之后就是不能识别。顺带ssh keys也设置了。
PS:我校验了应该是可以连接到GitHub的。
▶ ssh -T git@github.com
Hi RyanLiu0235! You've successfully authenticated, but GitHub does not provide shell access.
在项目的.git文件夹所在的目录下执行以下命令:
然后通过
git config --list
查看配置生效了没有。这样你
commit
到github上的帐户就是你刚才添加的。