I use both GitLab and GitHub(s) for different kinds of work. They all have their different Personal Access Tokens (PATs) that are displayed once at creation. Currently I put them in a password manager and copy/paste per repo or action. A frustrating, time-consuming, and mistake prone process.
Is there a way to configure git to use different credentials based on HTTPS endpoint? When I go to gitlab.com - whether cloning, pushing, creating, whatever - it uses one set of credentials, and when going to github.com it uses another?
I'm using the command line in MacOs & Windows WSL - both with zsh if that is important.