2015-12-17 22:08:37 +00:00
|
|
|
# git blame
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Show commit hash and last author on each line of a file.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://git-scm.com/docs/git-blame>.
|
2015-12-17 22:08:37 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Print file with author name and commit hash on each line:
|
2015-12-17 22:08:37 +00:00
|
|
|
|
2022-12-03 06:05:38 +00:00
|
|
|
`git blame {{path/to/file}}`
|
2015-12-17 22:08:37 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Print file with author email and commit hash on each line:
|
2015-12-17 22:08:37 +00:00
|
|
|
|
2022-12-03 06:05:38 +00:00
|
|
|
`git blame -e {{path/to/file}}`
|
2022-10-30 04:54:25 +00:00
|
|
|
|
|
|
|
- Print file with author name and commit hash on each line at a specific commit:
|
|
|
|
|
|
|
|
`git blame {{commit}} {{path/to/file}}`
|
|
|
|
|
|
|
|
- Print file with author name and commit hash on each line before a specific commit:
|
|
|
|
|
|
|
|
`git blame {{commit}}~ {{path/to/file}}`
|