2017-04-18 18:09:07 +01:00
|
|
|
# git show
|
|
|
|
|
2021-01-07 14:06:38 +00:00
|
|
|
> Show various types of Git objects (commits, tags, etc.).
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://git-scm.com/docs/git-show>.
|
2017-04-18 18:09:07 +01:00
|
|
|
|
2020-01-02 23:19:40 +00:00
|
|
|
- Show information about the latest commit (hash, message, changes, and other metadata):
|
2017-04-18 18:09:07 +01:00
|
|
|
|
|
|
|
`git show`
|
|
|
|
|
2017-04-19 21:25:28 +01:00
|
|
|
- Show information about a given commit:
|
2017-04-18 18:09:07 +01:00
|
|
|
|
|
|
|
`git show {{commit}}`
|
|
|
|
|
2017-04-19 21:25:28 +01:00
|
|
|
- Show information about the commit associated with a given tag:
|
2017-04-18 18:09:07 +01:00
|
|
|
|
|
|
|
`git show {{tag}}`
|
|
|
|
|
2020-11-10 11:17:06 +00:00
|
|
|
- Show information about the 3rd commit from the HEAD of a branch:
|
2017-04-18 18:09:07 +01:00
|
|
|
|
2017-04-19 21:25:28 +01:00
|
|
|
`git show {{branch}}~{{3}}`
|
|
|
|
|
2020-01-02 23:19:40 +00:00
|
|
|
- Show a commit's message in a single line, suppressing the diff output:
|
2017-04-19 21:25:28 +01:00
|
|
|
|
|
|
|
`git show --oneline -s {{commit}}`
|
2019-11-26 18:56:44 +00:00
|
|
|
|
2020-10-27 12:31:35 +00:00
|
|
|
- Show only statistics (added/removed characters) about the changed files:
|
2020-01-02 23:19:40 +00:00
|
|
|
|
|
|
|
`git show --stat {{commit}}`
|
|
|
|
|
2020-10-27 12:31:35 +00:00
|
|
|
- Show only the list of added, renamed or deleted files:
|
|
|
|
|
|
|
|
`git show --summary {{commit}}`
|
|
|
|
|
2019-11-26 18:56:44 +00:00
|
|
|
- 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}}`
|