Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

3 Ways to Find Commits in Bitbucket

Looking for an easy way to search for commits in your Bitbucket? In this article, we’ll explore three practical ways to simplify work with commits: 

Let's find out more about these approaches.

Sourcetree

Sourcetree is a Mercurial and Git client for Windows and Mac that allows users to search for commits based on authors, commit messages, and file changes. It has a user-friendly interface and makes work with commits much easier. However, it has limitations, such as manual navigation to each repository to find needed commits, installation on each computer, and incompatibility with Linux.

1.png

Awesome Graphs for Bitbucket

Awesome Graphs for Bitbucket is an on-prem solution that transforms invisible engineering activities into actionable graphs and reports, empowering engineering leaders and their teams to understand the development process better and enhance efficiency.

Even though it is not specifically focused on commit searches, it provides an effective way to find commit data, enabling searches by author, time period, project, or repository, even for huge Bitbucket instances with 70,000+ repos.

How to find commits made by a developer to all projects and repositories

You can see all contributions a particular user makes in the Contributions graph. It shows all activities over a year in the form of a calendar, making it easy to find all the commits made by a developer to all projects and repositories they worked on.

2.png

You can filter data by project, repo, and time period up to a year and see a list of all commits and pull requests below the calendar.

3.png

How to find the commits made to a particular project or repository

You can use the Activity graph to find commits made to a specific project or repository regardless of the author. In the Activity graph of a particular project, you can select multiple repositories to monitor and analyze two or more repos simultaneously without clicking through each one. Moreover, you can choose a specific time and filter data by team or user or combine these options.

4.png

How to find old commits

To find old commits, you can use the Top Committers Report. It is primarily designed to identify the most active contributors. However, you can adjust the time and select a specific author to access the commit history.

5.png

After filtering, it displays the list of all commits for the selected period in the Activity section below the report.

6.png

How to export commits to CSV

Awesome Graphs for Bitbucket provides an opportunity to export commits to a CSV file in two different ways. When exporting commit data to CSV, you’ll receive a list of commits with their details like the date of creation, author's name and email, repository and project name, and lines of code added and deleted.

7.png

To export data to CSV, go to the People page in the header of Bitbucket, and choose a period for which you want to explore commits. You can also select a particular team or users or combine these options. When all filters are set, select CSV in the Export menu at the top-right corner. You will receive a CSV file with filtered data.

csv_export.png

Another way to download commit data is by using Awesome Graphs REST API. It allows you to retrieve and export data at various levels: global, project, repository, and user. To learn more about it, you can go to our documentation. For Awesome Graphs’ users, we have the in-app documentation that can be found by choosing the Export menu in the top-right corner of the People page.

Bitbucket REST API

Bitbucket REST API allows getting the list of all commits in the repository using the following request:

https://example.com/rest/api/1.0/projects/{example-project-key}/repos/{example-repository-slug}/commits

 

By sending this request, you’ll get a JSON response with commits and their details, such as commit IDs, authors' names, email addresses, commit messages, and parents.

You can also add specific parameters to receive a more accurate result. For example, the start parameter determines which item should be used as the first item on the results page. The merges parameter controls whether merge commits are excluded, included with non-merge commits, or only returned with merge commits.

As an alternative, you can also use the Awesome Graphs REST API that allows exporting data on global, project, repository, and user levels. This tool lets you get data faster and reduce the instance load compared to Bitbucket REST API.

Here is the request to export a list of commits from the particular repository:

https://example.com/rest/awesome-graphs-api/latest/projects/{projectKey}/repos/{repositorySlug}/commits

These three approaches allow you to work with commits effectively and export them according to your needs. Try them all and find the most suitable way to optimize your development workflow.

 

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events