Git cheat sheet


Search for a file in a repo's commit history:

git log --all --full-history -- **/theFile.*

Count the number of commits for a revision (e.g., a branch):

# syntax:
git rev-list --count <revision>

# example:
git rev-list --count my-branch

Count the number of commits across all branches:

git rev-list --count --all

Sources