Skip to content

Instantly share code, notes, and snippets.

@rwaldron
Created June 15, 2011 16:08
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save rwaldron/1027426 to your computer and use it in GitHub Desktop.
Save rwaldron/1027426 to your computer and use it in GitHub Desktop.
Count number of branches in a repo
git branch | wc -l
@cedricbastin
Copy link

git branch --all | wc -l

@hovanesgasparian
Copy link

Thank you @cedricbastin! And I guess @rwaldron for creating this gist in the first place!

@saylikaranjkar-gep
Copy link

Can we get count against a single user in the repo?

@soufian-ze
Copy link

You can see the explanation of this command here

@soufian-ze
Copy link

@cedricbastin
git branch --all | wc -l this command list both remote-tracking branches and local branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment