tldr/pages/common/git-show.md

33 lines
806 B
Markdown
Raw Normal View History

2017-04-18 18:09:07 +01:00
# git show
> Show various types of git objects (commits, tags, etc.).
> More information: <https://git-scm.com/docs/git-show>.
2017-04-18 18:09:07 +01:00
- Show information about the latest commit (hash, message, changes, and other metadata):
2017-04-18 18:09:07 +01:00
`git show`
- Show information about a given commit:
2017-04-18 18:09:07 +01:00
`git show {{commit}}`
- Show information about the commit associated with a given tag:
2017-04-18 18:09:07 +01:00
`git show {{tag}}`
- Show information about the 3rd commit from the tip of a branch:
2017-04-18 18:09:07 +01:00
`git show {{branch}}~{{3}}`
- Show a commit's message in a single line, suppressing the diff output:
`git show --oneline -s {{commit}}`
- Show only the list of the files changed in a commit:
`git show --stat {{commit}}`
- Show the contents of a file as it was at a given revision (e.g. branch, tag or commit):
`git show {{revision}}:{{path/to/file}}`