###Setting up a Google Cloud Git Repo
// now with SourceTree bonus!
*Note: this guide is relavent only to repos natively hosted on Google Cloud
**Prereq:** - OSX - SourceTree - git - A Google App Engine / Cloud project
###Admin Setup: **Set up an App Engine Git Repo** - read this: https://developers.google.com/cloud/devtools/repo/push-to-deploy
Git Init
$ my-mbpro: cd ~/path/projectDirectory
$ my-mbpro: git init
Grab the Repo Url
- https://console.developers.google.com/project/
- left column > source code > browse
Set up SourceTree
- create repo
- menu: file > new/ clone > add working copy
- enter path + name > ok
- once added, open the repo via view > show bookmarks > click repo name
- make your first commit
then... - push repo
- menu: repository settings > remotes
- enter repo name + path (your repo url)
- click dropdown > select unknown
- add the google account email of for the project > ok
(if prompted for a google password here, good. If not, click push to push the branch up - you will be prompted during this)
#####Your next step is based on your account security setup, follow the one that applies:
- I Have 2-Factor Authentication Enabled:
- https://console.developers.google.com
- left panel > source code > releases
- click the link "Configure your repository" in the first paragraph
- in the second sentence, click the little help icon w/ a ?
- click the link "generate your git credentials"
- Create a file called .netrc in your home directory (~/.netrc).
- Unfortunately, the syntax requires you to store your passwords in plain text, so make sure you modify the file permissions to make it readable only to you.
- add the below credentials to your file .netrc file & paste in the provided name & pass
machine source.developers.google.com
login googleUsername
password yourPassword
And that's it! Subsequent git clone, git pull and git push requests will now be authenticated using the credentials specified in this file. - Add to SourceTree - menu: file > repository > push > tick master > ok - when prompted, paste token in the password field
- I Don't Have 2-Factor Authentication Enabled:
- Generate an application specific password
- Add to SourceTree
- menu: file > repository > push > tick master > ok
- when prompted, paste password
###Client Setup:
Grab the Repo Url
- https://console.developers.google.com/project/
- left column > source code > browse
Set up SourceTree
- menu: file > new/ clone > clone repository
- add the repo url > click once in the bookmark field
- add user name / pass (same authentication method as described above)
- choose destination / repo name > ok
🇺🇸
Thanks for this walk-through!
I am also trying to use SourceTree on a Google Cloud Source Repo, but I get stuck when I try to access the left panel > source code > releases menu. It is not present in my developers console, I only have left panel > source code > browse.
Is this because I skipped the push-to-deploy step? I read the page you link to, but did not do what is described there, because I don't want the complexity of Jenkins/Maven/Gradle and all the other stuff.