Hacker News new | ask | show | jobs
by perdjesk 1067 days ago
Using git-config it is possible to configure per directory/remote URL different signing keys.

  [includeIf "gitdir:~/work/client1/"]
   path = ~/work/client1/.gitconfig
  [includeIf "gitdir:~/work/client2/"]
   path = ~/work/client2/.gitconfig

 $ cat ~/work/client1/.gitconfig
  [user]
    email = emailforclient1
    name = nameforclient1
    signingKey = 3AA5C34371567BD2
  [core]
    sshCommand = ssh -i ~/.ssh/id_client1


 $ cat ~/work/client2/.gitconfig
  [user]
    email = emailforclient2
    name = nameforclient2
    signingKey = 4BB6D45482678BE3
  [core]
    sshCommand = ssh -i ~/.ssh/id_client2


See:

- https://news.ycombinator.com/item?id=36798978

- https://git-scm.com/docs/git-config#Documentation/git-config...