0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

gitアカウントの切り替え方法

Last updated at Posted at 2023-08-16

あまり需要はないが、ひとつのパソコンで複数の github アカウントを使い分ける場合は、以下のようにすると切り替えができる。

1. SSH キーを切り替える

~/.ssh/config
Host github.com
  IdentityFile ~/.ssh/github_userA_keyA
  #IdentityFile ~/.ssh/github_userB_keyB

2. メールアドレスを切り替える

~/.gitconfig
[user]
  name = userA
  email = userA@example.com
  #name = userB
  #email = userB@example.com
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?