Skip to content

Commit

Permalink
update(git-log): git log advanced filters
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 10, 2021
1 parent 3fa4a58 commit 5bf75d1
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions notes/programming/tools/git/gitBasicNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,57 @@ git log -p --stat --graph --pretty=format:"%h - %an, %ar : %s" --since=2.weeks p
| --before=/--until= | 限制日志时间 "2008-01-15" "2 years 1 day 3 minutes ago" |
| --help |

### Log Filter

#### Log by Amount

```bash
git log -3
```

#### Log by Date

- `before` and `until`
- `after` and `since`

```bash
git log --before="yesterday"
git log --after="1 week ago"
git log --after="2014-7-1" --before="2014-7-4"
```

#### Log by Author

```bash
git log --author="John\|Mary"
```

#### Log by Commit Message

```bash
git log --grep="feat"
git log --grep="fix"
```

#### Log by File

```bash
git log -- src/components/ErrorBoundary/ErrorBoundary.test.tsx
git log -- "*.test.tsx"
```

#### Log by Content

```bash
git log -S"Hello, World!"
```

#### Log by Range

```bash
git log main..feature
```

## Reflog

`git reflog show` is an alias for
Expand Down

0 comments on commit 5bf75d1

Please sign in to comment.