LoginSignup
5
5

More than 5 years have passed since last update.

1台のmacで複数のgithubアカウントを使う場合の備忘録

Posted at

githubを使っていて、1台のmacで個人用のgithubと会社用のgithubを使い分ける場合のポイント

  • ポイント1 以下のような設定ファイルを作る。(xxxには、個人と会社用で適宜命名) id_rsaファイル増えるので~/.ssh/以下にgithubフォルダを作った。

vi ~/.ssh/config

Host github-xxx
    HostName        github.com
    IdentityFile    ~/.ssh/github/xxx_rsa
    User            git
Host github-xxx
    HostName        github.com
    IdentityFile    ~/.ssh/github/xxx_rsa
    User            git
  • ポイント2 以下のようにgithub-xxxを指定する。

git remote add origin github-xxx:githubUserName/repository

5
5
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
5
5