Rosano / Journal

2 entries for Tuesday, February 24, 2026

How do I count all commits in a git repository?

# count for in branch alfa
git rev-list --count alfa

# count across all branches
git rev-list --count --all

How to cherry-pick commits from another repository in Git

# add the other repository's commits
git remote add alfa ../bravo
git fetch alfa

# show commits from branch charlie
# (note/copy the ones you want to merge or the start and end)
git log alfa/charlie --oneline

# apply commit 789c05c
git cherry-pick 789c05c

# apply commits 789c05c to fd1b130
git cherry-pick 789c05c..fd1b130