0

There's already another gitlab account being used. So all the git commits are being recorded in this account. How do I change this account? I tried changing git users the git way. git config --list shows the changed user but still the above gitlab account is being used. Any suggestion will be helpful.

1 Answers1

1

You are likely using a shared local account, which is not recommended, but everybody does anyway. The Gitlab login is using the ssh key, and the key is linked to a different account.

You can:

  • use nominative users instead of a shared account (recommended), each will have its own ssh keys and configuration;
  • configure multiple keys and multiple remotes (see Multiple GitHub Accounts & SSH Config);
  • change the SSH keys linked to the current account with your own (if you are the only one currently using that shared account) or unlink that SSH key from the previous user, and link it to your user on Gitlab (this is by far the worse solution);
  • use HTTPS instead of SSH (this -by default- will ask for credentials each time you pull/push/etc, allowing more users to use their credentials each time)

Docs: https://docs.gitlab.com/ee/ssh/

Iron Bishop
  • 1,749
  • 1
  • 7
  • 16