This post is a great reference of what’s possible with git config wrt includes/remotes, and I’m sure I’ll be getting back to it. One thing though: what’s the point of using separate keys for work/personal/github/gitlab? I fail to see a practical and security advantage over using one key (per workstation).
Privacy for sure. It's no ones business to know how certain accounts are related.
How I configure my Git identities
31–40 of 113 posts
Re: How I configure my Git identities
#32Re: How I configure my Git identities
#33This post is a great reference of what’s possible with git config wrt includes/remotes, and I’m sure I’ll be getting back to it. One thing though: what’s the point of using separate keys for work/personal/github/gitlab? I fail to see a practical and security advantage over using one key (per workstation).
GitHub does not allow you to share a key with another GitHub account anymore
In fact, I was one of not too many who used separate account for work, and people didn’t understand it, wondering why the hassle.
Re: How I configure my Git identities
#34This post is a great reference of what’s possible with git config wrt includes/remotes, and I’m sure I’ll be getting back to it. One thing though: what’s the point of using separate keys for work/personal/github/gitlab? I fail to see a practical and security advantage over using one key (per workstation).
These days I prefer to use local VMs to compartmentalize different areas of work (personal, consulting, etc) so my git config is plain and simple. Lately I’ve been doing mostly consulting work around open-source so I’ve been using my primary GH account for the most part, but separate VMs allow me to use a different key (account) without advanced git config incantations.
Re: How I configure my Git identities
#35I ended up creating a "SSH environment" manager 4 years ago to help with this: https://github.com/theonejb/sshenv
It's worked wonderfully for me since then, and it's something I use almost daily.
Re: How I configure my Git identities
#36Aside: I use NixOS with home-manager (on linux and mac), which makes this trivial [1]. Added the following lines to my home-manager config:
programs.git = {
enable = true;
...
includes = [
{
condition = "hasconfig:remote.*.url:git@github.com:/**";
contents = {
user.email = "";
};
}
];
}
[1]: https://nix-community.github.io/home-manager/options.xhtml#o...Re: How I configure my Git identities
#37Re: How I configure my Git identities
#38Is there a risk with not using different keys for work and personal? The private bits are all in the same place: if one is compromised, so are the rest.
About signing keys, it would make sense stopping using a signing key (marking it as such and deleting it) once you stop a job. Your signing key for personal projects probably has a different temporality.
What does this achieve exactly?
Re: How I configure my Git identities
#39Why have multiple git identities in the same machine? I use a single different key with each machine and that's it.