LoginSignup
3
6

More than 5 years have passed since last update.

Githubでアカウントを使い分ける

Last updated at Posted at 2017-03-29

通常ユーザとは別のアカウントを使う必要がある場合

新しい鍵を作成する

$ cd ~/.ssh
$ ssh-keygen -t rsa -f new_account

new_account.pubをGithubに登録する。

.ssh/configを設定する

~/.ssh/config
Host new_account
  Hostname github.com
  User git
  IdentityFile C:\Users\hoge\.ssh\new_account

Gitのユーザ情報を設定

$ git config user.name 'new_account'
$ git config user.email 'new@example.com'

remote.origin.urlを設定

$ git config remote.origin.url new_account:hoge/hoge.git
3
6
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
3
6