Google Cloud Repository push fatal: remote error: Forbidden

7.7k Views Asked by At

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 [email protected] --ignore-unknown $@']' returned non-zero exit status 128
6

There are 6 best solutions below

4
On

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).

0
On

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

0
On

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

git config --system --unset credential.helper
0
On

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
0
On

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

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

0
On

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.