aboutsummaryrefslogtreecommitdiff
path: root/Personal/draft/multiple_ssh_key_setting.md
blob: 07772dc7a41fd7af398c6f1e3420fc2a1ba8916f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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