Skip to content

How to use gitlab personal access token instead of password with local git

How to use gitlab personal access token instead of password with local git

In this post we will learn how we can use gitlab personal access token instead of a password with local git(cmd) in windows. This is needed incase you have two-factor authentication (2FA) enabled in gitlab.

Follow the link to know about and create/revoke personal access token in gitlab.

  1. Once you have you personal access token, in windows,
    • go to Control Panel -> Credential Manager -> Windows Credentials.
  2. Find the credentials related to your git account and edit it.
  3. Replace your password with the personal access token you copied from gitlab.
  4. See below image for reference:
Git credentials settings in Windows Credentials, use gitlab personal access token
Git credentials settings in Windows Credentials

That’s it now git is using your personal access token instead of you password. Hope this helps 🙂

Further Reading

How to run NodeJS server as Windows service

Please share