As of today, on OSX El Yosemite, if you have install gcloud through brew cask (conveniently), when you want to push a local git repo to google cloud source repo (for example to use console debugging) you must type the following:
1/
'gcloud init'
presumably to change you default project to the current one, maybe other params too
2/
'git config credential.helper gcloud'
Do NOT use .sh (BEWARE: the online help is wrong when it says gcloud.sh)
Ultimately the gcloud sdk installation points to youinstalldir/google-cloud-sdk/latest/google-cloud-sdk/bin/git-credential-gcloud.sh.
But the 'git config credential.helper' command needs only this part of the full file name.
'which git-credential-gcloud' must display the path to the file, in my case: /usr/local/bin/git-credential-gcloud
And 'ls -al /usr/local/bin/git-credential-gcloud' will show where the link goes, in my case: /usr/local/bin/git-credential-gcloud -> /opt/homebrew-cask/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/git-credential-gcloud.sh
3/
This is given by google on the cloud console
git push google master
(you must have a repo with at least one commit for it to work)
4/
to check the repo config:
'git config --local -l'
or simply open the .git/config text file
Check also the difference with you global config
particularly to see you usual credential.helper (maybe osxkeychain if you use githug) is not impacted by this repo local config.
It took some time to figure all this. So I thought it might help people.
Thx