Here’s the command to create an image from an existing VM instance. You can create an image from disks, snapshots, images or from a cloud storage file. You can use images you built to launch and restore VM instances, as well as create Instance Templates.
gcloud compute --project=your-project images create your-server --source-disk=your-server --source-disk-zone=us-central1-c
Here’s the gcloud command to create a snapshot of your GCP instance.
gcloud compute disks snapshot your-server \
Here are the steps on how to clone a Google Cloud Platform (GCP) repository. This is assuming you already installed Google Cloud SDK.
gcloud source repos clone name_of_repo --project=project_name
git commit -a -m "your comment"
git push -u origin master
When working with version control, sometimes you would like to know what files were committed locally vs what’s on the master origin repository. One way to know the difference is to use the git diff or the git log commands. Here are the commands to check the differences between the local and master origin repositories. Diff is better in my opinion since it actually displays the code changes instead of just displaying the commit ID.
$ git diff origin/master..HEAD
$ git log origin/master..HEAD
If you need to special characters encoded in a URL, these sites really come handy. Why is there a need to encode? URLs accepts only alphanumeric characters and a limited number of special characters. For example, : and / are common characters you’ll find in URLs. Meanwhile spaces are not allowed, but instead are represented as %20 when encoded. There are other special characters that will need to be encoded.
Here are a couple of sites to help you encode: