From 6bcdab4d7393420cbce7f78edb1d5fb35ba5409a Mon Sep 17 00:00:00 2001 From: Raniere Silva Date: Fri, 26 Sep 2014 23:06:35 -0300 Subject: [PATCH 1/2] Add note about git log options Close #745. --- novice/git/01-backup.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/novice/git/01-backup.md b/novice/git/01-backup.md index 8603df860..02fb95d61 100644 --- a/novice/git/01-backup.md +++ b/novice/git/01-backup.md @@ -534,6 +534,34 @@ Date: Thu Aug 22 09:51:46 2013 -0400 ~~~ {:class="out"} +> #### Log Options +> +> `git log` has many options that are quite useful. You can combine some to get +> a "better" view of the history of your project. +> +> ~~~ +> $ git log --oneline --graph --all --decorate +> ~~~ +> {:class="in"} +> ~~~ +> * 005937f Thoughts about the climate (HEAD, master) +> * 34961b1 Concerns about Mars's moons on my furry friend +> * f22b25e Starting to think about Mars +> ~~~ +> {:class="out"} +> +> You can also limit the number of commits to be printed: +> +> ~~~ +> $ git log --oneline --graph --all --decorate -2 +> ~~~ +> {:class="in"} +> ~~~ +> * 005937f Thoughts about the climate (HEAD, master) +> * 34961b1 Concerns about Mars's moons on my furry friend +> ~~~ +> {:class="out"} + To recap, when we want to add changes to our repository, we first need to add the changed files to the staging area (`git add`) and then commit the staged changes to the From f162d2864bb7436c116022ceded743ffe48fc3b2 Mon Sep 17 00:00:00 2001 From: Raniere Silva Date: Sun, 28 Sep 2014 10:43:32 -0300 Subject: [PATCH 2/2] Emphasis on --oneline of git log This was suggested by @jiffyclub. --- novice/git/01-backup.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/novice/git/01-backup.md b/novice/git/01-backup.md index 02fb95d61..9155e5efc 100644 --- a/novice/git/01-backup.md +++ b/novice/git/01-backup.md @@ -536,8 +536,22 @@ Date: Thu Aug 22 09:51:46 2013 -0400 > #### Log Options > -> `git log` has many options that are quite useful. You can combine some to get -> a "better" view of the history of your project. +> To avoid that `git log` cover all your terminal screen you can use the +> `--oneline` option: +> +> ~~~ +> $ git log --oneline +> ~~~ +> {:class="in"} +> ~~~ +> * 005937f Thoughts about the climate +> * 34961b1 Concerns about Mars's moons on my furry friend +> * f22b25e Starting to think about Mars +> ~~~ +> {:class="out"} +> +> You can also combine the `--oneline` options with others. One useful +> combination is > > ~~~ > $ git log --oneline --graph --all --decorate