Ask HN: How do you manage multiple Git profiles (GitHub, Gitlab, Bitbucket)?
(For example) I have a personal GitHub, a work GitLab, and a secret Bitbucket project.
How do you handle multiple Git identities? Any tools, workflows, or best practices you recommend?
Are you talking about your git name and email? Because you can set that (and other settings) per-repo simply by omitting --global in `git config`.
If you have multiple github accounts, you can use separate keys by defining custom hosts in your ssh config, but that doesn't seem relevant in your case.
Yes, I assume different emails/names and ssh keys. Of course, I can do manual configuration, but I think it is a bit "tiresome".
Can I ask what you find tiresome, specifically? If it's because you have tons of repos, there's a little-known git feature where you can set the config for all repos in a directory, so that e.g. ~/work/* uses your work name & email, without having to `git config` every new repo you create or clone. https://alysivji.github.io/multiple-gitconfig-files.html
Yes, I understand the capabilities of git... But, it still seems too tedious to me. In general, I have already solved this problem for myself quite a long time ago by making a small utility that, when cloning a repository (no matter where and no matter where), offers to choose one of the available git profiles (and keys). In this way, I can easily work with each repository separately, have several profiles for github, gitlab, and so on.
But I was wondering if anyone has solved a similar problem or uses some ready-made tool)