Git Diff Head

Here’s how to check what’s changed in your local Git repo vs the master repo.

Git Status tells you what file has changed, but not to the level of detail such as what lines or what code was changed.

git diff HEAD

Storing Git Credentials

There are two ways to store git credentials. One is temporary and the other permanent. You can store your git credentials unencrypted on disk forever or in cache memory temporarily.

Temporary. Store for 15 minutes.

git config credential.helper 'cache --timeout=900'

Permanent.

git config credential.helper store
git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>

Next time you use git, you will not be prompted for a password.

Cloning A GCP Repo

Here are the steps on how to clone a Google Cloud Platform (GCP) repository. This is assuming you already installed Google Cloud SDK.

gcloud init
gcloud source repos clone name_of_repo --project=project_name
cd name_of_repo
git commit -a -m "your comment"
git push -u origin master

Git Diff

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

GitLab Moves to GCP

Gitlab is moving from Microsoft Azure to Google Cloud Platform mainly due to its integration with Google Kubernetes Engine. Gitlab believes Kubernetes is the future and makes their platform to massively scale as it grows. The move is scheduled on July 28. Gitlab plans to use their Geo product for the migration of Gitlab.com. For more, read the article.