Skip to content

Instantly share code, notes, and snippets.

@fengzhao
Created October 23, 2020 15:11
Show Gist options
  • Save fengzhao/cba0728b035a96e5c00808590c069683 to your computer and use it in GitHub Desktop.
Save fengzhao/cba0728b035a96e5c00808590c069683 to your computer and use it in GitHub Desktop.
github多帐号登录的问题
修改 ~/.ssh/config, 设置如下
Host unix2dos
HostName github.com
IdentityFile ~/.ssh/github-unix2dos
User unix2dos
Host levonfly
HostName github.com
IdentityFile ~/.ssh/github-levonfly
User levonfly
ssh -T git@unix2dos
ssh -T git@levonfly
# 要修改仓库的 remote url, 对应 ~/.ssh/config 所填写的值. 注意, 要修改 git@后面的这个值
git remote set-url origin git@unix2dos:unix2dos/LevonRecord.git
# 一定要设置用户名和邮箱.否则虽然可以提交 commit, 但是不认识你是谁
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment