Live data from Hacker News

Show HN: Karn – Manage multiple Git identities

github.com

1–10 of 15 posts

Re: Show HN: Karn – Manage multiple Git identities

#4
post #3

A more generic tool for this type of function is direnv[ http://direnv.net/ ]. I use direnv for example for setting per-directory Perl installation variables to keep my development environments separate.

From my (admittedly brief) glance at the documentation, this seems like the opposite of direnv. direnv would allow you to set up configuration values on a per-directory basis, by adding a file in the directory in question. git supports this already, you can simply change the config for the repository in question. The goal of this package appears to automate this so that one doesn't need to reconfigure each individual folder.

Re: Show HN: Karn – Manage multiple Git identities

#6

Does this handle management of SSH keys?

I already do this with a simple shell script:

  if [ $1 == "home" ]; then
        ssh-add -D
        ssh-add ~/.ssh/id_rsa_home
        ssh -T git@github-home
        exit;
  fi
where in ~/.ssh/config:

  Host github-home
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_home
    IdentitiesOnly yes

Re: Show HN: Karn – Manage multiple Git identities

#8
post #6

Does this handle management of SSH keys?

I already do this with a simple shell script: if [ $1 == "home" ]; then ssh-add -D ssh-add ~/.ssh/id_rsa_home ssh -T git@github-home exit; fi where in ~/.ssh/config: Host github-home HostName github.com User git IdentityFile ~/.ssh/id_rsa_home IdentitiesOnly yes

I also have stuff like this lying around. Please don't tell Github because I seem to remember it is against their policy.

:)

Re: Show HN: Karn – Manage multiple Git identities

#10
post #8
post #6

Earlier quoted context omitted.

I already do this with a simple shell script: if [ $1 == "home" ]; then ssh-add -D ssh-add ~/.ssh/id_rsa_home ssh -T git@github-home exit; fi where in ~/.ssh/config: Host github-home HostName github.com User git IdentityFile ~/.ssh/id_rsa_home IdentitiesOnly yes

I also have stuff like this lying around. Please don't tell Github because I seem to remember it is against their policy. :)

Actually they're okay with it. I checked with them about how to do this and they recommended a single account instead. When I said I needed to keep my corporate and personal accounts separate for policy reasons, they were fine with it.
Post reply on HN