Syncing codebase to google cloud

Posted: 15 September, 2018 Category: code Tagged: gcp

In order to start playing with cloud functions, you have to host the functions somewhere. That's where GCP's cloud repos come in.

After you create a cloud repo: because of how github works, gcp will need access to both your public and private repos if you want to automatically sync these to your cloud repo on google. If you're not comfy with that and have feverish dreams of the panoptican rummaging through your code (in which case... dude, why are you even on GCP?)... then add your cloud repo as a remote instead, from your local workspace:

git remote add google https://source.developers.google.com/p/projectId/r/<repositoryName>

Now you can simply push to the GCP remote whenever needed. In these examples, the remote was simply named "google":

# this seems to trigger windows credential manager popup. Looks like you can cancel out of it, and push still works.
git push --all google

Happy repo-ing.