debian-mirror-gitlab/doc/topics/git/git_log.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.1 KiB
Markdown
Raw Normal View History

2021-06-08 01:23:25 +05:30
---
2021-09-04 01:27:46 +05:30
stage: Create
group: Source Code
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2021-06-08 01:23:25 +05:30
comments: false
---
2021-09-04 01:27:46 +05:30
# Git Log **(FREE)**
2021-06-08 01:23:25 +05:30
Git log lists commit history. It allows searching and filtering.
- Initiate log:
```shell
git log
```
- Retrieve set number of records:
```shell
git log -n 2
```
- Search commits by author. Allows user name or a regular expression.
```shell
git log --author="user_name"
```
- Search by comment message:
```shell
git log --grep="<pattern>"
```
- Search by date:
```shell
git log --since=1.month.ago --until=3.weeks.ago
```
## Git Log Workflow
1. Change to workspace directory
1. Clone the multi runner projects
1. Change to project dir
1. Search by author
1. Search by date
1. Combine
## Commands
```shell
cd ~/workspace
git clone git@gitlab.com:gitlab-org/gitlab-runner.git
cd gitlab-runner
git log --author="Travis"
git log --since=1.month.ago --until=3.weeks.ago
git log --since=1.month.ago --until=1.day.ago --author="Travis"
```