diff --git a/README.md b/README.md index 9220065..5f993d0 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [List ignored files.](#list-ignored-files) * [Status of ignored files.](#status-of-ignored-files) * [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2) +* [List n last commits](#list-n-last-commits) * [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions) * [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor) * [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption) @@ -777,6 +778,17 @@ git status --ignored git log Branch1 ^Branch2 ``` +## List n last commits +```sh +git log - +``` + + +__Alternatives:__ +```sh +git log -n +``` + ## Reuse recorded resolution, record and reuse previous conflicts resolutions. ```sh git config --global rerere.enabled 1 diff --git a/tips.json b/tips.json index 568afc3..b2c216c 100644 --- a/tips.json +++ b/tips.json @@ -300,6 +300,10 @@ }, { "title": "Commits in Branch1 that are not in Branch2", "tip": "git log Branch1 ^Branch2" +}, { + "title": "List n last commits", + "tip": "git log -", + "alternatives": ["git log -n "] }, { "title": "Reuse recorded resolution, record and reuse previous conflicts resolutions.", "tip": "git config --global rerere.enabled 1"