How can I get the total commits from Bitbucket private repo?

frangeris October 20, 2013

How can I get the total commits from Bitbucket private repo?

3 answers

1 accepted

9 votes
Answer accepted
Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 20, 2013

You could use the Bitbucket API, the endpoint below returns the 15 most recent changesets, but also returns a count which is the total number of changesets.

https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/changesets/

Check out the REST API Console (http://restbrowser.bitbucket.org/) to play with the API.

https://confluence.atlassian.com/display/BITBUCKET/changesets+Resource#changesetsResource-GETalistofchangesets

aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2013

You can also simply clone the repository and run the following command in GitBash or OSX terminal:

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

This will output every commit in the repository, one per line, then count all the lines.

Like # people like this
JeremyKastner June 16, 2016

Wow, awesome.

5 votes
stick100 September 2, 2018

This is out of date, please remove or update with API 2.0 methods.  API 1.0 methods are no longer allowed.

1 vote
arvind_kushwaha April 1, 2020

how to get this in API 2.0?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events