DEV Community

Discussion on: 7 Git tricks that changed my life

Collapse
 
anirudhann profile image
Anirudhan • Edited

Nice Article ! Although point 1 autocorrect has been super helpful for me (thank you), point 2 counting the commits in a particular branch doesn't work to me [I tried to count commits in a particular branch which was a child branch of some other branch but showing the entire commit counts of the repository]

Collapse
 
nafis profile image
Nafis Fuad • Edited

The correct command is: git rev-list --count

In the article, there's just one hyphen instead of two before the count. Probably a typo.
Great article, loved it :)

Collapse
 
anirudhann profile image
Anirudhan • Edited

Not talking about the typo dude, Even I used two hyphens only. It will show the count, no doubt !

My point is that --

Lets say branch 'b' (child branch) which is taken from branch 'a' (parent branch), when i try to count the commits made only in branch 'b' - it will list the total commits including i did in the branch 'a'. (it will display total commits made in the repo or at least from its parent tree - will not show that accurate count on that particular child branch)