Authentication for git google cloud repository

17,775 views
Skip to first unread message

Babu

unread,
Apr 24, 2016, 10:23:58 PM4/24/16
to google-cloud-sdk
Hello,
I am new to Google Cloud Repository and git. I tried to follow the steps in Source Code tab in "https://console.cloud.google.com/code/develop?project=myproject-code to push my git repository to cloud. The instructions specified there (after installing gcloud sdk) are
1. gcloud init && git config credential.helper gcloud.cmd
2.  git remote add google https://source.developers.google.com/p/myproject-code/r/default
3. git push --all google

The commands are run in windows 8.1 command prompt. "git" is already setup. The first command above is asking me to login - and I am logging with my gmail address and password.
The second command also seems to run properly.
The third command is returning an error:

"ERROR: (gcloud.auth.git-helper) Invalid input line format: [path=]. fatal: remote error: Invalid username/password. You may need to use your OAuth token password; Note that generated google.com passwords are not compatible with private repositories"

I was not able to figure out if this is an error from git or from gcloud. Can you guide me on what to do and how to setup? Sorry if it is a basic question...

Regards
Babu

Arthur Cherba

unread,
Apr 25, 2016, 8:54:26 AM4/25/16
to Babu, google-cloud-sdk
The error is coming from gcloud, which git invokes during git push.

After step 1, are you able to do run any other gcloud commands.
For example [gcloud compute project-info describe] or if you do not use compute [gcloud alpha source repos list].
Also does [gcloud source repos clone default] work for you which is uses git and gcloud in same way to step 3.

I would check if this user have access to the project repo:


--
You received this message because you are subscribed to the Google Groups "google-cloud-sdk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-cloud-sdk.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sdk/bc380144-3af1-499f-93f9-709978056e0f%40googlegroups.com.

Babu

unread,
Apr 25, 2016, 9:43:34 AM4/25/16
to google-cloud-sdk, bab...@gmail.com
Thank you for the answers.. I checked as you suggested after giving the init commands (1)
The command "gcloud alpha source repos list" is listing 2 repositories, "default" and "myproject" on my local PC windows command prompt.
The command "gcloud source repos clone default" is returning error (below) similar to push command

"Cloning into '<mylocaldirectoryname>'...
ERROR: (gcloud.auth.git-helper) Invalid input line format: [path=].
fatal: remote error: Invalid username/password.
You may need to use your OAuth token password; Note that generated google.com passwords are not compatible with private repositories"

The link you suggested "https://console.cloud.google.com/code/develop/browse/default/master?project=myproject-code" is bringing up a source code page with pull down menus with two repositories. But no source code is seen - only a root directory /.

Hopefully it gives you some idea of the mistake I am making? 

Regards
Vinod

Arthur Cherba

unread,
Apr 25, 2016, 10:08:28 AM4/25/16
to Babu, google-cloud-sdk
What git version are you using, that is what is output of
  git --version

Also just to double check if you change directory into your existing repository
  git config --list
do you get
  credential.helper=gcloud.cmd
in the output?


Babu

unread,
Apr 25, 2016, 10:46:58 AM4/25/16
to google-cloud-sdk, bab...@gmail.com
git --version gives
git version 2.8.1.windows.1

Also I see that "credential.helper=gcloud.cmd" is present in the output of git config --list when run in the directory. The whole output is pasted below...
Thanks again..

core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
gui.wmstate=normal
gui.geometry=887x427+78+78 171 192
credential.helper=gcloud.cmd
remote.google.fetch=+refs/heads/*:refs/remotes/google/*

Arthur Cherba

unread,
Apr 25, 2016, 11:09:58 AM4/25/16
to Babu, google-cloud-sdk
I see that you have credential manager setup

> git config --list --system
credential.helper=manager


Can you unset it and try again:
  git config --system --unset credential.helper


Babu

unread,
Apr 25, 2016, 11:21:05 AM4/25/16
to google-cloud-sdk, bab...@gmail.com
Thank you Arther..,

That did the trick. After I did the "git config --system --unset credential.helper" as you suggested, I am able to push and clone the repository.

Regards
Reply all
Reply to author
Forward
0 new messages