Skip to content

Instantly share code, notes, and snippets.

@mikybars
Last active January 26, 2020 09:17
Show Gist options
  • Select an option

  • Save mikybars/03c22810e2a5e3c6f6a7b3920f69c7c3 to your computer and use it in GitHub Desktop.

Select an option

Save mikybars/03c22810e2a5e3c6f6a7b3920f69c7c3 to your computer and use it in GitHub Desktop.
Use cases for git show
# View a commit by id (without an id it defaults to HEAD i.e. the last commit)
$ git show 512b26a
# View only the list of modified files in the commit
$ git show 512b26a --name-only
# View the DIFF of the file(s) inside the commit
$ git show 512b26a pom.xml
# View the CONTENTS of the file at a certain revision
$ git show 512b26a:pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment