With Subversion I could use TortoiseSVN to view the history/log of a file.
How can I do this with Git?
Just looking for history record for a particular file, and then the ability to compare the different versions.
This question is related to
git
timeline
git-diff
git-log
revision-history
Of course, if you want something as close to TortoiseSVN as possible, you could just use TortoiseGit.
TortoiseGit also provides a command line tool to do see the history of a file. Using PowerShell:
C:\Program` Files\TortoiseGit\bin\TortoiseGitProc.exe /command:log /path:"c:\path\to\your\file.txt"
git log --all -- path/to/file
should work
I like to use gitk name_of_file
This shows a nice list of the changes that happened to a file at each commit, instead of showing the changes to all the files. Makes it easier to track down something that happened.
Many Git history browsers, including git log
(and 'git log --graph'), gitk (in Tcl/Tk, part of Git), QGit (in Qt), tig (text mode interface to git, using ncurses), Giggle (in GTK+), TortoiseGit and git-cheetah support path limiting (e.g. gitk path/to/file
).
My favorite is git log -p <filename>
, which will give you a history of all the commits of the given file as well as the diffs for each commit.
you could also use tig for a nice, ncurses-based git repository browser. To view history of a file:
tig path/to/file
Source: Stackoverflow.com