DEV Community


Posted on • Updated on

How to access gitlab from git cli using personal access token?

  1. Step

Create a personal access token by following

  1. Step

Using the personal access tokens to authenticate lets clone a repository.

Form your url as shown below. Replace the personal_token with the token you have got.

# To clone using personal token
git clone 
Enter fullscreen mode Exit fullscreen mode

If the project is already cloned and you have done few commits already by painstakingly providing the login and token every time then do this:

  1. Open the file .git/config in vscode or any editor you prefer
  2. Change the url as show below with your personal access token
[remote "origin"]
        url =
        fetch = +refs/heads/*:refs/remotes/origin/*
Enter fullscreen mode Exit fullscreen mode

Top comments (0)