Skip to main content

Command Palette

Search for a command to run...

Git Show Command Cheat Sheet

Published
2 min readView as Markdown
Git Show Command Cheat Sheet
V

I would like to Build -> Ship -> Get Feedback -> Optimise -> Repeat

Open source So far to popular repositories:

Contribution To Elastic Search:

  1. https://tinyurl.com/yxwqm4q2
  2. https://tinyurl.com/y27ynp3j

Contribution To Bitly G-OauthProxy:

  1. Support for multi white listed urls with regex url match - https://tinyurl.com/y5rb3wzg

A Beginner's Guide for the 'git show' command

Git is a powerful version control system that allows developers to track and manage changes to their code. One of the most useful Git commands is git show, which allows you to view the details of a specific commit. In this post, we'll explore the git show command and provide a cheat sheet of some of the most commonly used options.

1. Basic Usage

The basic usage of the git show command is to display the details of a specific commit. You can use the following syntax to view the details of a commit:

git show <commit-hash>

This command will display the commit message, the author, the date, and the changes made in the commit.

2. Showing Changes

One of the most useful options of the git show command is the ability to view the changes made in a specific commit. You can use the following syntax to view the changes made in a commit:

git show <commit-hash> --stat

This command will display a summary of the changes made in the commit, including the number of files changed and the number of lines added or removed.

3. Showing Diffs

Another useful option of the git show command is the ability to view the actual diffs (differences) made in a specific commit. You can use the following syntax to view the diffs made in a commit:

git show <commit-hash> --patch

This command will display the actual diffs made in the commit, including the lines added and removed.

4. Showing File Changes

You can also use the git show command to view the changes made to a specific file in a specific commit. You can use the following syntax to view the changes made to a file:

git show <commit-hash> <file-path>

This command will display the changes made to the specified file in the specified commit.

5. Showing Branch

you can also use git show command to see the latest commit on a branch, you can use the following syntax

git show <branch-name>

Conclusion:

The git show command is a powerful Git command that allows you to view the details of a specific commit. It's a useful tool for understanding the changes made to your code and for debugging. The basic usage, showing changes, showing diffs, showing file changes, and showing branch are some of the most commonly used options of the git show command. By mastering these options, you can quickly and easily view the details of specific commits in your Git repository.

Cheatsheets

Part 2 of 11

In this series, i will be publishing multiple posts on Cheatsheets on different technologies which developers should know.

Up next

Kubernetes Cheatsheet

Kubernetes commands that Developers and DevOps should know