DEV Community

Discussion on: Using Git with two or more users

Collapse
 
hutger profile image
hutger

Hi there, an alternative approach in cases when you have multiple different users and multiple repos, ssh config file (~/.ssh/config) can be also very handy.
e.g.

Host github-1
  HostName github.com
  User git
  IdentityFile <key_path_1>

Host github-2
  HostName github.com
  User git
  IdentityFile <key_path_1>
Enter fullscreen mode Exit fullscreen mode

and then

git clone git@github-1:hutger/my-repo.git
Enter fullscreen mode Exit fullscreen mode