SVN's log has a "-v" mode that outputs filenames of files changed in each commit, like so:
jes5199$ svn log -v ------------------------------------------------------------------------ r1 | jes5199 | 2007-01-03 14:39:41 -0800 (Wed, 03 Jan 2007) | 1 line Changed paths: A /AUTHORS A /COPYING A /ChangeLog A /EVOLUTION A /INSTALL A /MacOSX
Is there a quick way to get a list of changed files in each commit in git?
I use this on a daily basis to show history with files that changed:
To keep it short, add an alias in your
.gitconfig
by doing:git show
is also a great command.It's kind of like
svn diff
, but you can pass it a commit guid and see that diff.NOTE:
git whatchanged
is deprecated, usegit log
insteadYou can use the command
git whatchanged --stat
to get a list of files that changed in each commit (along with the commit message).References
git diff --stat HEAD^!
shows changed files and added/removed line counts for the last commit (HEAD
).It seems to me that there is no single command to get concise output consisting only of filenames and added and removed line counts for several commits at once, so I created my own bash script for that:
To be called eg.
./changed_files 99
to get the changes in a concise form fromHEAD
toHEAD~99
. Can be piped eg. toless
.For full path names of changed files:
For full path names and status of changed files:
For abbreviated pathnames and a diffstat of changed files:
There's a lot more options, check out the docs.
If you want to get the file names only without the rest of the commit message you can use:
This can then be extended to use the various options that contain the file name:
One thing to note when using this method is that there are some blank lines in the output that will have to be ignored. Using this can be useful if you'd like to see the files that have been changed on a local branch, but is not yet pushed to a remote branch and there is no guarantee the latest from the remote has already been pulled in. For example:
Would show all the files that have been changed on the local branch, but not yet merged to the master branch on the remote.