I
I
ilovemaryjane2018-11-08 14:28:19
git
ilovemaryjane, 2018-11-08 14:28:19

How to use multiple bitbucket/github accounts from one machine in git?

There are 2 bitbucket/github accounts - user1 and user2
Accordingly, there are 2 different access keys.
I made a config file, but after a reboot there are access errors

Host bitbucket.org
  User user1
  Hostname bitbucket.org
  IdentityFile ~/.ssh/user1

Host bitbucket.org
  User user2
  Hostname bitbucket.org
  IdentityFile ~/.ssh/user2

How to do it correctly so that the machine / git knows which key to use when (depending on which rep push)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-11-08
@ilovemaryjane

https://stackoverflow.com/a/7927828/7436149

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question