多个 SSH Keys 用于多个git账号
account Refer To Link
Change SHH config#
vim $HOME/.ssh/config
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_activehacker
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_jexchan
Change project git config#
vim .git/config
Modify config#
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
- url = git@github.com:<username>/<project>.git
+ url = git@github.com-personal:<username>/<project>.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
name = <username>
email = <email>
阅读其他文章