User Tools

Site Tools


git_show

This is an old revision of the document!


Overview

The git show command has a number of interesting variations.

Showing a commit

The regular way

$ git show v4.12
tag v4.12
Tagger: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Jul 2 16:07:11 2017 -0700

Linux 4.12
-----BEGIN PGP SIGNATURE-----

iQEcBAABAgAGBQJZWXyfAAoJEHm+PkMAQRiGUSgH/36/pHSuUXjiwbeExWGl80tU
1sq62VBO2CUZdjgqxESdapRzmQZpiYJNfl5lo7p0UgW5GcSdxtB/9DXLJaIFu3z/
xB0i4OmZc6GX6hxY/Ve2ZbxjzMRyQYluzjbtT+mKrzkw6HWdxz19OAKpdDFqYoga
2TGerVSi2GHMe7N09T4fKIiRdfsmrj6AGPJ52t6w/Hv8SgxGv3yFHV0lPMgcwED9
Pmx8E/dU9wcXu5ou3gWwqxa5ODEjrgmDLD1g0+tFJVhHFszrhSmgqIteK478fPAs
cLfOo1AyzCQwqxhk34ppxmKheq6RRQzIynfd/bdmi/fWVwU9YlaTHixuc8pVViM=
=HBF4
-----END PGP SIGNATURE-----

commit 6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Jul 2 16:07:02 2017 -0700

    Linux 4.12

diff --git a/Makefile b/Makefile
index 6d8a984..283c623 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 4
 PATCHLEVEL = 12
 SUBLEVEL = 0
-EXTRAVERSION = -rc7
+EXTRAVERSION =
 NAME = Fearless Coyote
 
 # *DOCUMENTATION*
$

The ''--stat'' way

$ git show --stat v4.12
tag v4.12
Tagger: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Jul 2 16:07:11 2017 -0700

Linux 4.12
-----BEGIN PGP SIGNATURE-----

iQEcBAABAgAGBQJZWXyfAAoJEHm+PkMAQRiGUSgH/36/pHSuUXjiwbeExWGl80tU
1sq62VBO2CUZdjgqxESdapRzmQZpiYJNfl5lo7p0UgW5GcSdxtB/9DXLJaIFu3z/
xB0i4OmZc6GX6hxY/Ve2ZbxjzMRyQYluzjbtT+mKrzkw6HWdxz19OAKpdDFqYoga
2TGerVSi2GHMe7N09T4fKIiRdfsmrj6AGPJ52t6w/Hv8SgxGv3yFHV0lPMgcwED9
Pmx8E/dU9wcXu5ou3gWwqxa5ODEjrgmDLD1g0+tFJVhHFszrhSmgqIteK478fPAs
cLfOo1AyzCQwqxhk34ppxmKheq6RRQzIynfd/bdmi/fWVwU9YlaTHixuc8pVViM=
=HBF4
-----END PGP SIGNATURE-----

commit 6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Jul 2 16:07:02 2017 -0700

    Linux 4.12

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
$

Showing a file

Showing the current file:

$ git show HEAD:Makefile
$ git show master:Makefile

Showing an earlier file:

$ git show v4.0:Makefile

Showing the index version of a file:

$ git show :Makefile
git_show.1518019946.txt.gz · Last modified: 2018/02/07 16:12 by rpjday