3 ms·
Ask HN: Visualize every Git changes to a file at once?
Given the discussion around commit messages I would like to know if there is any tool that can visualize every change to a file in one go?
I want to vertically visualize the history of a given file over time and not simply by to different commits.
Something like this:
[Commit1] File.txt: hello world
[Commit2] File.txt: world hello
[Commit3] File.txt: hello wallo
I dont want to use git blame to shuffle around all the changes, but I want all the changes and the whole file to be visualized in one big list.
Does it make sense ?
- foobarbaz33 3y agoYou 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