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.
- Once you have you personal access token, in windows,
- go to Control Panel -> Credential Manager -> Windows Credentials.
- Find the credentials related to your git account and edit it.
- Replace your password with the personal access token you copied from gitlab.
- See below image for reference:
That’s it now git is using your personal access token instead of you password. Hope this helps 🙂