Hacker News new | ask | show | jobs
by cbcoutinho 1775 days ago
Are you open to using a tool like direnv to manage env vars on a directory-wide basis? I used to also suffer from the same paranoia, but direnv has allowed me to take back control regarding directory-specific configuration.

You can configure it to set your git user name/email based on your working directory, for example. This is how I keep the separation you mentioned between personal and work on the same machine

1 comments

Would something like that exist on Windows?

Also, it doesn't seem to solve the problem of multiple accounts; I more or less accepted I need to manually configure user.name and user.email for each clone, but the account is not part of the same config, it looks like it's stored in some other ephemeral place - maybe GCM Core, or some Credential Manager or who knows.

I only realize it was using the wrong account when I try to push and get some unauthorized error; by that point, my commit log is polluted with the wrong account so I need to do some gymnastics where I reset the authentication, manually copy over files or unstage to purge the metadata, etc.