Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 1 | git-show(1) |
2 | =========== | ||||
3 | |||||
4 | NAME | ||||
5 | ---- | ||||
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 6 | git-show - Show various types of objects |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 7 | |
8 | |||||
9 | SYNOPSIS | ||||
10 | -------- | ||||
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | c9cb517 | 2018-06-01 07:13:44 | [diff] [blame] | 12 | 'git show' [<options>] [<object>...] |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 13 | |
14 | DESCRIPTION | ||||
15 | ----------- | ||||
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 16 | Shows one or more objects (blobs, trees, tags and commits). |
17 | |||||
18 | For commits it shows the log message and textual diff. It also | ||||
19 | presents the merge commit in a special format as produced by | ||||
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 20 | 'git diff-tree --cc'. |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 21 | |
22 | For tags, it shows the tag message and the referenced objects. | ||||
23 | |||||
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 24 | For trees, it shows the names (equivalent to 'git ls-tree' |
Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 25 | with --name-only). |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 26 | |
27 | For plain blobs, it shows the plain contents. | ||||
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 28 | |
Junio C Hamano | 2b1164d | 2023-09-29 16:43:29 | [diff] [blame] | 29 | Some options that 'git log' command understands can be used to |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 30 | control how the changes the commit introduces are shown. |
31 | |||||
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 32 | This manual page describes only the most frequently used options. |
33 | |||||
34 | |||||
35 | OPTIONS | ||||
36 | ------- | ||||
Junio C Hamano | 9e39507 | 2008-07-31 22:11:21 | [diff] [blame] | 37 | <object>...:: |
Junio C Hamano | 640779d | 2018-02-14 01:29:14 | [diff] [blame] | 38 | The names of objects to show (defaults to 'HEAD'). |
Junio C Hamano | 2d47c62 | 2007-01-18 06:24:10 | [diff] [blame] | 39 | For a more complete list of ways to spell object names, see |
Junio C Hamano | c27b733 | 2010-10-14 04:37:28 | [diff] [blame] | 40 | "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7]. |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 41 | |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 42 | include::pretty-options.txt[] |
43 | |||||
44 | |||||
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 45 | include::pretty-formats.txt[] |
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 46 | |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 47 | |
Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 48 | DIFF FORMATTING |
49 | --------------- | ||||
50 | The options below can be used to change the way `git show` generates | ||||
51 | diff output. | ||||
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 52 | |
53 | :git-log: 1 | ||||
Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 54 | :diff-merges-default: `dense-combined` |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 55 | include::diff-options.txt[] |
56 | |||||
57 | include::diff-generate-patch.txt[] | ||||
58 | |||||
59 | |||||
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 60 | EXAMPLES |
61 | -------- | ||||
62 | |||||
Junio C Hamano | 16ebcd0 | 2011-08-05 00:05:45 | [diff] [blame] | 63 | `git show v1.0.0`:: |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 64 | Shows the tag `v1.0.0`, along with the object the tag |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 65 | points at. |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 66 | |
Junio C Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 67 | `git show v1.0.0^{tree}`:: |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 68 | Shows the tree pointed to by the tag `v1.0.0`. |
69 | |||||
Junio C Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 70 | `git show -s --format=%s v1.0.0^{commit}`:: |
Junio C Hamano | c3fda57 | 2010-11-09 19:41:30 | [diff] [blame] | 71 | Shows the subject of the commit pointed to by the |
72 | tag `v1.0.0`. | ||||
73 | |||||
Junio C Hamano | 16ebcd0 | 2011-08-05 00:05:45 | [diff] [blame] | 74 | `git show next~10:Documentation/README`:: |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 75 | Shows the contents of the file `Documentation/README` as |
76 | they were current in the 10th last commit of the branch | ||||
77 | `next`. | ||||
78 | |||||
Junio C Hamano | 16ebcd0 | 2011-08-05 00:05:45 | [diff] [blame] | 79 | `git show master:Makefile master:t/Makefile`:: |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 80 | Concatenates the contents of said Makefiles in the head |
81 | of the branch `master`. | ||||
82 | |||||
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 83 | DISCUSSION |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 84 | ---------- |
85 | |||||
86 | include::i18n.txt[] | ||||
87 | |||||
Junio C Hamano | d9d71c0 | 2006-02-08 00:52:33 | [diff] [blame] | 88 | GIT |
89 | --- | ||||
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 90 | Part of the linkgit:git[1] suite |