= git log =
Show current branch commits:
$ git log
To show only commits of an individual file, run this command:
$ git log -- <file>
To show commits of the particular file with diffs for each change:
$ git log -p -- <file>
Show the entire history of a file (including history beyond renames):
$ git log --follow -p -- <file>
= git show =
show file list changed in given commit:
git show --name-only <sha>
git show --pretty="" --name-only bd61ad98
= list files in commit =
https://stackoverflow.com/questions/424071/how-to-list-all-the-files-in-a-commit
Preferred Way (because it's a plumbing command; meant to be programmatic):
$ git diff-tree --no-commit-id --name-only -r bd61ad98 index.html javascript/application.js javascript/ie6.js
Another Way (less preferred for scripts, because it's a porcelain command; meant to be user-facing)
$ git show --pretty="" --name-only bd61ad98 index.html javascript/application.js javascript/ie6.js
--no-commit-id
suppresses the commit ID output.--pretty
argument specifies an empty format string to avoid the cruft at the beginning.--name-only
argument shows only the file names that were affected (Thanks Hank).-r
argument is to recurse into sub-treesIf you want to get list of all files in a commit, you can use
git ls-tree --name-only -r <commit-ish>