Each project on GCP has a Git repository which can be accessed by the GCE instances. Though we can manually move the code to an instance, moving it to Source Repositories gives the ability for the compute instances to pull the code automatically via a start up script:
- If you have made any changes to the code, you can commit the code to the local repository:
git commit -am "Ready to be committed to GCP"
- Create a new repository under the project:
- Follow the steps to upload the code from the local repository to Google Source Repositories. In the following example, the project ID is gcp-cookbook ...