Skip to main content

Show a history of commits.

# To show the sequence of commits starting from the current one, in reverse chronological order of the git repository in the current working directory:
git log

# To show the history of a particular file or directory, including differences:
git log -p <path/to/file_or_directory>

# To show an overview of which file(s) changed in each commit:
git log --stat

# To show a graph of commits in the current branch using only the first line of each commit message:
git log --oneline --graph

# To show a graph of all commits, tags and branches in the entire repo:
git log --oneline --decorate --all --graph

# To show only commits whose messages include a given string (case-insensitively):
git log -i --grep <search_string>

# To show the last N commits from a certain author:
git log -n <number> --author=<author>

# To show commits between two dates:
git log --before=<date> --after=<date>