Search code examples
gitmercurial

Total Count of Change Sets for Mercurial and Git


Is it possible to count the number of Mercurial/Git changesets (commits) with a simple command line with arguments?


Solution

  • For git:

    git log --pretty=oneline | wc -l
    

    will give you the count of all commits on the current branch back to the original commit.

    To get the count of all commits on all branches:

    git log --pretty=oneline --all | wc -l