2017-11-01 11:56:40 -04:00
|
|
|
---
|
|
|
|
comments: false
|
|
|
|
---
|
|
|
|
|
2016-10-20 06:38:32 -04:00
|
|
|
# Git Log
|
|
|
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
Git log lists commit history. It allows searching and filtering.
|
|
|
|
|
|
|
|
* Initiate log
|
2018-09-06 12:52:18 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
git log
|
|
|
|
```
|
2016-10-20 06:38:32 -04:00
|
|
|
|
|
|
|
* Retrieve set number of records:
|
2018-09-06 12:52:18 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
git log -n 2
|
|
|
|
```
|
2016-10-20 06:38:32 -04:00
|
|
|
|
|
|
|
* Search commits by author. Allows user name or a regular expression.
|
2018-09-06 12:52:18 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
git log --author="user_name"
|
|
|
|
```
|
2016-10-20 06:38:32 -04:00
|
|
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
* Search by comment message.
|
2018-09-06 12:52:18 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
git log --grep="<pattern>"
|
|
|
|
```
|
2016-10-20 06:38:32 -04:00
|
|
|
|
|
|
|
* Search by date
|
2018-09-06 12:52:18 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
git log --since=1.month.ago --until=3.weeks.ago
|
|
|
|
```
|
2016-10-20 06:38:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
## Git Log Workflow
|
|
|
|
|
|
|
|
1. Change to workspace directory
|
2018-11-12 19:39:21 -05:00
|
|
|
1. Clone the multi runner projects
|
|
|
|
1. Change to project dir
|
|
|
|
1. Search by author
|
|
|
|
1. Search by date
|
|
|
|
1. Combine
|
2016-10-20 06:38:32 -04:00
|
|
|
|
|
|
|
----------
|
|
|
|
|
|
|
|
## Commands
|
|
|
|
|
|
|
|
```
|
|
|
|
cd ~/workspace
|
2017-10-31 05:20:40 -04:00
|
|
|
git clone git@gitlab.com:gitlab-org/gitlab-runner.git
|
|
|
|
cd gitlab-runner
|
2016-10-20 06:38:32 -04:00
|
|
|
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"
|
|
|
|
```
|