6

I have just signed up to try google cloud repository and am trying the getting started list and failed on the

git remote add google https://source.developers.google.com/p/*name-xxxxxx*/r/default

git push google master
fatal: remote error: Forbidden

I can't tell if they think I don't have permission, I am the owner of the organization project

I created a repository in the Source Tools Console

I then attempt to follow their direction to create a local repository and it fails:

gcloud source repos clone source --project=project-xxxxxx
Cloning into 'xxx\\source'...
ERROR: (gcloud.auth.git-helper) Invalid input line format: [path=].
fatal: remote error:


Invalid authentication credentials.

Please generate a new identifier:
  https://source.developers.google.com/auth/start?scopes=https://www.googleapis.com/auth/cloud-platform

ERROR: (gcloud.source.repos.clone) Command '['git', 'clone', 'https://source.developers.google.com/p/project-xxxxxx/r/source', 'xxx\\source', '--config', 'credential.helper=!gcloud.cmd auth git-helper --account=aaa@bbb.com --ignore-unknown $@']' returned non-zero exit status 128
A.Queue
  • 1,549
  • 6
  • 21
Nefarious
  • 458
  • 6
  • 21
  • It's necessary to put the ssh public key of your local machine/user in the remote host server. If you cannot access the server directly, there should be some interface in Google Cloud which can add your public key. – ElpieKay Jan 31 '17 at 02:00

6 Answers6

3

It looks there was a conflict on credential manager between gcloud and existing git setup.

I ran the following to unset the credential manager and it allowed me to clone the gcloud repo.

>  git config --system --unset credential.helper
gtiwari333
  • 24,554
  • 15
  • 75
  • 102
1

I had to create a repository on Google Cloud Platform -> Development -> Repositories

Following GCloud code lab, I had to create default repository there.

ViliusK
  • 11,345
  • 4
  • 67
  • 71
1

Mistakenly I've tried to push to a repo that wasn't 100% set up correctly.

git remote -v

Will show you remote names along w/ full URL path origin.

0

The exact format of the Cloud Source Repositories URL is https://source.developers.google.com/p/${project_id}/r/${repo_name}. It appears that you are trying to use your project number instead of your project id.

To find your project ID from your project number, you can run:

gcloud projects list --filter PROJECT_NUMBER=${project_number}

Also make sure that you are authenticating with the correct account. You can see the active account gcloud is using by running:

gcloud auth list

If you are still having problems cloning your repository, I would try making sure your version of gcloud is up to date (e.g. gcloud components update).

Billy Lynch
  • 136
  • 3
  • I just didn't put the project id in the post, I didn't think it was a good idea to give that to everyone that reads this. The project-id is of the form name-6Digits. That's what I used when I submitted the request. In the first entry I inadvertently called it project-number and number was the 6 digit value for the id. I will edit the post and make that more clear. – Nefarious Jan 31 '17 at 19:47
  • I ran gcloud auth list and it returned my email address so that seems correct. I ran gcloud components update and it reported All components are up to date. – Nefarious Jan 31 '17 at 19:51
  • Try reaching out to Cloud Support with your project ID here: https://support.google.com/cloud/answer/6282346 – Billy Lynch Feb 01 '17 at 17:27
  • @BillyLynch Bronze users can't access to tecnical support :( – John Balvin Arias Sep 18 '18 at 16:56
0

After running @gtiwari333 command, opened CMD with admin permissions and was able to run the gcloud source repos clone default --project=myprojectsname command

diferno
  • 114
  • 4
0

just run the following command in the terminal but you have to run it as administrator first

git config --system --unset credential.helper
Kamal El-Saaid
  • 145
  • 2
  • 11