All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-reflog.txt: add an EXAMPLES section
@ 2022-10-03  8:46 Elia Pinto
  2022-10-03  9:20 ` Ævar Arnfjörð Bjarmason
  2022-10-03 13:07 ` Bagas Sanjaya
  0 siblings, 2 replies; 7+ messages in thread
From: Elia Pinto @ 2022-10-03  8:46 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

This commit adds an "EXAMPLES" section to the git reflog man page.
This new section currently provides examples of using git reflog
with branches, for which doubts often exist. In this commit we also
add a "SEE ALSO" section which refers to further information
on git commands or documentation referenced in the git reflog man page.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 Documentation/git-reflog.txt | 42 ++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt
index 70791b9fd8..5bbd5958fe 100644
--- a/Documentation/git-reflog.txt
+++ b/Documentation/git-reflog.txt
@@ -96,6 +96,48 @@ them.
 --verbose::
 	Print extra information on screen.
 
+EXAMPLES
+--------
+
+`git reflog`::
+	Lists entries of reflog of HEAD, starting at `HEAD@{0}`.
+
+`git reflog HEAD`::
+	The same.
+
+`git reflog show HEAD`::
+	The same.
+
+`git reflog HEAD@{4}`::
+	The same, starting at the 4th prior value of HEAD.
+
+`git reflog master`::
+	Lists entries of reflog of `master`.
+
+`git reflog master@{0}`::
+	The same.
+
+`git reflog master@{now}`::
+	The same, show with timestamp.
+
+`git reflog master@{4.minutes}`::
+	The same, starting at master, 4 minutes ago.
+
+For the branch that is currently checked out, you can omit the name
+when you use any of the @{..} notation, so
+
+`git reflog @{0}`
+
+`git reflog @{now}`
+
+are often the easiest ways to view what you did on the current
+branch
+
+SEE ALSO
+--------
+linkgit:gitrevisions[7],
+linkgit:git-log[1]
+
 GIT
 ---
 Part of the linkgit:git[1] suite
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-03 16:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03  8:46 [PATCH] git-reflog.txt: add an EXAMPLES section Elia Pinto
2022-10-03  9:20 ` Ævar Arnfjörð Bjarmason
2022-10-03 13:53   ` Elia Pinto
2022-10-03 16:40     ` Junio C Hamano
2022-10-03 16:31   ` Junio C Hamano
2022-10-03 13:07 ` Bagas Sanjaya
2022-10-03 16:36   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.