Skip to content

Commit d81094d

Browse files
authored
Merge pull request git-tips#135 from shfshanyue/master
Add tip: git log -n
2 parents e3f8804 + 3ab7c65 commit d81094d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
104104
* [List ignored files.](#list-ignored-files)
105105
* [Status of ignored files.](#status-of-ignored-files)
106106
* [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2)
107+
* [List n last commits](#list-n-last-commits)
107108
* [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions)
108109
* [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor)
109110
* [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
777778
git log Branch1 ^Branch2
778779
```
779780

781+
## List n last commits
782+
```sh
783+
git log -<n>
784+
```
785+
786+
787+
__Alternatives:__
788+
```sh
789+
git log -n <n>
790+
```
791+
780792
## Reuse recorded resolution, record and reuse previous conflicts resolutions.
781793
```sh
782794
git config --global rerere.enabled 1

0 commit comments

Comments
 (0)