diff options
| author | Steve Lee <me@xiangyangli.com> | 2017-12-02 06:10:20 +0800 |
|---|---|---|
| committer | Steve Lee <me@xiangyangli.com> | 2017-12-02 06:10:20 +0800 |
| commit | 9b939e65cf007e859dabe5de6b31d255d647e0ce (patch) | |
| tree | bf9229755f4e58bb81add73c7f3c32fe4023e7ec /Personal/draft/multiple_ssh_key_setting.md | |
| parent | 5dc061ae68ac3b5b28556bdbd1574579d8da33e7 (diff) | |
| download | 42-9b939e65cf007e859dabe5de6b31d255d647e0ce.tar.xz 42-9b939e65cf007e859dabe5de6b31d255d647e0ce.zip | |
category
Diffstat (limited to 'Personal/draft/multiple_ssh_key_setting.md')
| -rw-r--r-- | Personal/draft/multiple_ssh_key_setting.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Personal/draft/multiple_ssh_key_setting.md b/Personal/draft/multiple_ssh_key_setting.md new file mode 100644 index 0000000..07772dc --- /dev/null +++ b/Personal/draft/multiple_ssh_key_setting.md @@ -0,0 +1,24 @@ +~/.ssh/config alias +gitDir/.git/config + +change + +# ~/.ssh/config +Host work + HostName bitbucket.org + IdentityFile ~/.ssh/work + +Host personal + HostName bitbucket.org + IdentityFile ~/.ssh/personal +And then in my project's local git config, I changed the host part of the remote URL to the appropriate host. For example, in the following file: + +# ~/repos/myworkproject/.git/config +# or you can access this file by going into the repo and running `git config -e` +...snip... +[remote "origin"] + fetch = ... + url = git@bitbucket.org:mybitbucketusername/myworkproject.git +Change the url line to: + +url = git@work:mybitbucketusername/myworkproject.git |
