5 ms·
You can view both the log and the diffs combined into 1 output. git log -p -- filename This can be a bit overwhelming with huge output, so I prefer to vie
by foobarbaz33 3y ago
You can view both the log and the diffs combined into 1 output.
git log -p -- filename
This can be a bit overwhelming with huge output, so I prefer to view the history log and the diffs separately.
I pipe the raw log into tig, a viewer that provides some interactivity.
git log -- filename | tig
Within tig you can use Vim-like searching to jump around to and view diffs, etc.
# navigate to each commits with vim-like search
/commit
# press "n" to go to next commit
n
# press Enter to see diff, q to quit diff window
<RET> q
- foobarbaz33 3y ago> I want... the whole file to be visualized After reading your post more closely i see you want the entire file contents, not just the diff. Or maybe the full file contents with diff markers included? That would likely produce HUGE, mostly redundant output. I would avoid that and just use the diffs. For the occasional time where I want to see the full file contents at a specific commit, I'd redirect the file contents to a temporary file. # dump specific version of file into a temp file git show commit:filename.txt > filenameTemp.txt