using gitlab token to clone without authentication

Muky picture Muky · Aug 20, 2014 · Viewed 152.1k times · Source

I want to clone gitlab repository without prompt for my automation script, by using my private token from my gitlab account.

Can someone provide me a sample?

I know I can do so with user and password:

git clone https://" + user + ":" + password + "@" + gitlaburl;

and I know it is possible with ssh key

but, both options are not sufficent

Answer

Roshan Gautam picture Roshan Gautam · Apr 10, 2015

I know this is old but this is how you do it:

git clone https://oauth2:[email protected]/vendor/package.git