mirror of
https://github.com/sahinakkaya/til.git
synced 2024-12-22 07:09:39 +01:00
TIL: Viewing history of a file
This commit is contained in:
parent
26b40e0075
commit
de267250fd
17
git/viewing-history-of-a-file.md
Normal file
17
git/viewing-history-of-a-file.md
Normal file
@ -0,0 +1,17 @@
|
||||
You can add filename to `git log` to view all the commit history of a file:
|
||||
|
||||
```
|
||||
git log my_file
|
||||
```
|
||||
|
||||
If you want to view diff's, at `-p` option:
|
||||
```
|
||||
git log -p my_file
|
||||
```
|
||||
|
||||
If you want to continue listing the file history beyond renames add `--follow` option:
|
||||
```
|
||||
git log --follow -p my_file
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user