4 ms·
Show HN: Karn – Manage multiple Git identities
- cakey 12y agoThis will definitely be useful for helping switch between work and personal projects on the same laptop!
- mlawren 12y agoA more generic tool for this type of function is direnv[http://direnv.net/ http://direnv.net/]. I use direnv for example for setting per-directory Perl installation variables to keep my development environments separate.
- ethomson 12y agoFrom 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.
- mrdrozdov 12y agoDoes this handle management of SSH keys?
- hliyan 12y agoI 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
- cies 12y agoI also have stuff like this lying around. Please don't tell Github because I seem to remember it is against their policy. :)
- hliyan 12y agoActually 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.
- kbody 12y agoI was hoping that as well, that's the main challenge with multiple identities, but it seems it's not included on karn :(
- prydonius 12y agoThe focus of karn right now is to manage repository-level configuration. I think setting up different hosts in SSH config is a better way to manage SSH keys.
- deleted 12y ago[deleted]
- 32bitkid 12y agoI don't mean to be a fuddy-duddy, but I don't get it... How is this better/worse than doing... git config user.name Foobar git config user.email foo@bar.com ...which will set that config variable for the current repository only -- not global. I ended up do the a similar thing for a simple git pairing tool[1] that would let you set your name to two people, so that one could discern the pair from the commit logs [1]:https://github.com/32bitkid/git-working-with https://github.com/32bitkid/git-working-with
- prydonius 12y agoI built karn to avoid situations where I've forgotten to update the config after cloning a new repository. With karn, any repository under `~/Work`, for example, will automatically be configured to use the correct identity. Also, since it's all in one configuration file, that makes it really easy to maintain and keep it in sync with multiple machines.
- detaro 12y agoIt stops you from forgetting to do that. Especially for small, quick things like spell-fix PRs to random github projects it has happened to me that I forgot to set the right user before making and publishing commits.
- machinshin_ 12y agoheh. the last time i saw this implemented, it was called gas => https://github.com/walle/gas https://github.com/walle/gas