LoginSignup
0
1

More than 5 years have passed since last update.

同一端末で、複数のgithubのアカウントを使いたい(自分メモ)

Last updated at Posted at 2016-12-06
  1. 公開鍵、秘密鍵を作成する

    $ ssh-keygen -t rsa -C "メールアドレス" -f ~/.ssh/新しい鍵のファイル名

  2. ~/.ssh/configの設定


    Host 適当に(github-新しいアカウント名など)
    HostName github.com
    IdentityFile ~/.ssh/new_id_rsa # 作成した秘密鍵を指定
    User git
    TCPKeepAlive yes
    IdentitiesOnly yes

3.作成した公開鍵をGitHubに登録する

4.作成したリモートリポジトリをローカルに登録

$ git remote add origin git@.ssh/configのHostNameの名前:githubの新アカウント名/XXX.git

0
1
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
1