Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clone Google Source Repository without gcloud

I am currently cloning the git repository present in Google Cloud Source repository using

gcloud source repos clone sample_repo --project=sample_project

Can I clone git repository present in Google Cloud Source Repository without using gcloud? Like,

git clone https://source.developers.google.com/p/sample_project/r/sample_repo
like image 316
sag Avatar asked Mar 07 '23 07:03

sag


1 Answers

gcloud does not do much when cloning, it only sets up credentials. In fact if you run

$ gcloud source repos clone default --dry-run

command (with --dry-run flag) you will see the git command gcloud runs under the hood:

git clone https://source.developers.google.com/p/YOUR_PROJECT/r/default \ --config credential.helper='!gcloud auth git-helper --account=YOUR_ACCOUNT --ignore-unknown $@'

gcloud credential helper essentially just provides access token for the account. So if you have a way to get credentials you can wire in them into git this way.

like image 91
cherba Avatar answered Mar 16 '23 23:03

cherba