From 5cb62ebbffa473bf9b53d230da8be138715dc19f Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Wed, 19 Apr 2017 21:25:28 +0100 Subject: [PATCH] git-show: various tweaks (#1341) - adjust punctuation & spacing in main description - adjust descriptions ("changes" --> "information", and explicitly list which info is returned in the first example) - use a concrete example for the tilde notation - add abbreviated example --- pages/common/git-show.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pages/common/git-show.md b/pages/common/git-show.md index 7e2dc8dc8d..8e402a8ffe 100644 --- a/pages/common/git-show.md +++ b/pages/common/git-show.md @@ -1,19 +1,23 @@ # git show -> Show various types of git objects(commits, tags etc.). +> Show various types of git objects (commits, tags, etc.). -- Show changes made in the latest commit: +- Show information about the latest commit (message, changes, and other metadata): `git show` -- Show changes made in a given commit: +- Show information about a given commit: `git show {{commit}}` -- Show changes made in the commit with a given tag: +- Show information about the commit associated with a given tag: `git show {{tag}}` -- Show the changes made n commits ago on a branch: +- Show information about the 3rd commit from the tip of a branch: -`git show {{branch}}~{{n}}` +`git show {{branch}}~{{3}}` + +- Show a commit's hash and message in a single line, suppressing the diff output: + +`git show --oneline -s {{commit}}`