komrad gitlab credential
Answer git's credential helper protocol with a GitLab connection's token
komrad gitlab credentialAnswer git when it asks for a password.
Git runs this and describes what it wants to reach. This answers only for https to a host connected as a GitLab forge with a token. Anything else gets no answer, so git falls back to whatever else the account has configured.
Set it up for each GitLab host with:
git config --global credential.https://gitlab.com.helper '!komrad gitlab credential'