DEV Community

Discussion on: 15 Git Commands You May Not Know

Collapse
 
tomakesense profile image
Kevin Xiong

My small contribution

1.Count the number of commits on a branch
git rev-list --count master

2.Count number of branches in a git repository
git branch | wc -l

3.Delete remote branch cache in your local repository
git fetch -p

4.Delete remote tag cache in your local repository
git fetch -p -P

5.Delete a git alias
git config --global --unset alias.XXX

6.List git aliases
git config --list | grep alias