stiltsoft.com Open in urlscan Pro
35.208.2.162  Public Scan

URL: https://stiltsoft.com/blog/2021/05/how-to-search-for-commits-in-bitbucket-server-and-data-center/
Submission: On August 17 via manual from US — Scanned from DE

Form analysis 2 forms found in the DOM

GET https://stiltsoft.com/blog/

<form role="search" method="get" class="search-form" action="https://stiltsoft.com/blog/">
  <label>
    <span class="screen-reader-text">Search for:</span>
    <input type="search" class="search-form__field" placeholder="Search …" value="" name="s" title="Search for:">
  </label>
  <button type="submit" class="search-form__submit btn"><i class="material-icons">search</i></button>
</form>

POST

<form method="POST" action="" class="subscribe-block__form"><input type="hidden" id="wild_ride_subscribe" name="wild_ride_subscribe" value="539c9d031e"><input type="hidden" name="_wp_http_referer"
    value="/blog/2021/05/how-to-search-for-commits-in-bitbucket-server-and-data-center/">
  <div class="subscribe-block__input-group"><input class="subscribe-block__input" type="email" name="subscribe-mail" value="" placeholder="Your email"><a href="#" class="subscribe-block__submit btn">Subscribe</a></div>
  <div class="subscribe-block__messages">
    <div class="subscribe-block__success hidden">You successfully subscribed</div>
    <div class="subscribe-block__error hidden"></div>
  </div>
</form>

Text Content

Skip to content
 * Twitter
 * Linkedin
 * YouTube


menu
 * Home
 * Apps
 * About
 * Partners
 * Blog

Atlassian Bitbucket How To


HOW TO SEARCH FOR COMMITS IN BITBUCKET SERVER AND DATA CENTER

Posted by Anastasia VoronovaeventMay 17, 2021

Bitbucket has greatly improved the development workflow of teams and companies
that use Git with its friendly interface and features. However, sometimes it
lacks opportunities for convenient work with commits. Have you ever wasted time
scrolling the mouse wheel trying to find some of the old commits? Luckily, there
are some ways to make your life easier and search for commits in Bitbucket. In
this article, you will learn how to find:

 * projects and repositories in your Bitbucket that a certain user contributed
   to (filter by author)
 * commits that were made long ago to a repository with high activity (filter by
   time)
 * the commits of a user made to a repository or project (filter by author and
   project/repo)
 * all the commits made to a project (filter by project).

We’ll also show you how to automate the process using the Bitbucket REST API, as
well as the Awesome Graphs REST API and the Export to CSV feature.


SOURCETREE SEARCH OPPORTUNITIES

Sourcetree is an Atlassian desktop client for working with Git and Mercurial
repositories. It provides an opportunity to search for commits by an author, a
commit message, and a file.

Its user-friendly interface helps find commits easier, but it’s impossible
to look at them for all repositories at once as you need to go to each repo
manually. Besides, it needs to be installed on each computer separately and is
not available for Linux.


USE AWESOME GRAPHS TO SEARCH COMMITS IN BITBUCKET

Awesome Graphs for Bitbucket helps engineering leaders and software teams
improve their processes and deliver products faster by transforming invisible
development activities into easy-to-understand insights and reports. Convenient
search for commits isn’t its main purpose, but a nice bonus.

This app indexes information about commits, which makes searching by author,
time, or repository faster and does not affect even huge Bitbucket instances
(70,000+ repositories).

The Contributions graph shows the activity of each developer during a year as a
calendar. So it’s an easy way to find all the commits made by a person to all
projects and repositories. Here you can also filter the commits of a particular
user by time period (up to a year) and by project or repository.



Below the calendar, there is a list of all commits made during the selected time
span. By default, it’s a year, but it’s possible to choose any period to
display.



In order to find the commits made to a certain repository regardless of their
author, use the Activity graph. It shows all commits for the last year or a
shorter time span in the Activity section below the charts.



And if you need to find commits made long ago, the Top Committers Report can be
a good solution. In general, its use-case is to find the most active
contributors of the project or repository, but you can configure the Period of
time and choose Authors of the commits you’re searching for.



As a result, it shows the list of all commits for the selected time span in the
Activity section below as well as their distribution in time.




EXPORT COMMIT DATA TO CSV

Awesome Graphs for Bitbucket also gives you the capability to export commit data
to CSV in different ways. As a result, you’ll get a list of commits with their
details:



To export raw commit data to CSV directly from Bitbucket, you need to go to
the People page. There you’ll notice the Export menu at the top-right corner,
where you can choose CSV.



Another way to export commit data to CSV is to use the Awesome Graphs REST API,
which allows you to automate the processes and retrieve this data easier using
the dedicated resources.

You can access the in-app documentation (accessible to Awesome Graphs’ users) by
choosing Export → REST API on the People page or go to our documentation
website.


SEARCH FOR COMMITS IN BITBUCKET VIA REST API

Bitbucket REST API provides a possibility to get the list of all commits in the
repository using this request.

https://example.com/rest/api/1.0/projects/exampleprojectkey/repos/example-repository-slug/commits

The request can be extended by specific parameters to receive a more accurate
result. For instance, since and until options help to get the commits made after
or before a certain commit, or between two commits defined by their IDs. Merges
parameter controls how to handle merge commits – exclude merge commits, include
both merge commits and non-merge commits, or only return merge commits.

https://example.com/rest/api/1.0/projects/exampleprojectkey/repos/example-repository-slug/commits?merges=exclude&since=ea3eea9dcbd&until=f4240bf022a

As a result, you receive a JSON response with the list of the commits and their
IDs, author’s names and email addresses, commit messages, and parents.

{
    "values": [
        {
            "id": "f4240bf022a69815241a883c03645444b58ac553",
            "displayId": "f4240bf022a",
            "author": {
                "name": "Max Desiatov",
                "emailAddress": "max@desiatov.com"
            },
            "authorTimestamp": 1557113671000,
            "committer": {
                "name": "Tomer Doron",
                "emailAddress": "tomer@apple.com"
            },
            "committerTimestamp": 1557113671000,
            "message": "Add internal section link to README.md (#71)",
            "parents": [
                {
                    "id": "ea3eea9dcbd46887d846696261f54b3d2f74fecd",
                    "displayId": "ea3eea9dcbd"
                }
            ]
        },



Alternatively, you can use the Awesome Graphs REST API that provides global,
user, project, and repository data. The solution allows you to retrieve data
faster while decreasing the load on the instance compared to Bitbucket REST
API. 

Use this request to get a list of commits from the specified repository.

https://example.com/rest/awesome-graphs-api/latest/projects/exampleprojectkey/repos/example-repository-slug/commits

The response will look as follows:

{
  "values": [
    {
      "user": {
        "emailAddress": "yorlov@stiltsoft.com",
        "displayName": "Administrator",
        "name": "admin"
      },
      "author": {
        "displayName": "admin",
        "emailAddress": "yorlov@stiltsoft.com"
      },
      "authorTimestamp": "2020-03-05T22:58:18Z",
      "linesOfCode": {
        "added": 1,
        "deleted": 0
      },
      "parents": [],
      "repository": {
        "slug": "Commit Hook",
        "name": "commit-hook",
        "project": {
          "key": "TESTCONTAINERS",
          "name": "Testcontainers",
          "type": "NORMAL"
        }
      },
      "id": "9f2e24a147bb8f5a5a3d10b692703cc5784df8b5"
    },
  ],
}

Learn more about the available REST API resources.


FIND OUT WHAT WORKS BEST FOR YOU

We’ve described different ways to work with commits effectively:

 * Sourcetree as a free application that is suitable for searching among a small
   number of repositories.
 * Awesome Graphs for Bitbucket add-on as a tool with wide search opportunities
   and various analytical features.
 * Bitbucket REST API as a more advanced and technically demanding option.

Try them all and find the best solution!

You can also read how other teams benefit from using Bitbucket in a bundle with
Awesome Graphs:

 * Check how researchers track developer productivity
 * Discover how engineers analyze code review practices 
 * Learn how a consulting team evaluates code quality in Bitbucket
 * Find out the way team leads track team activity
 * Read how a FinTech company improves code review processes

 

Facebook
Twitter
Google+
LinkedIn
Pinterest


POST NAVIGATION

How to Make Charts and Graphs in Confluence
Price Increase for Handy Macros for Confluence Server/DC

Search for: search

NEWSLETTER

I want to receive the latest news of this blog
Subscribe
You successfully subscribed


 * 5 Tips to Become a…
 * How to Export Commit…
 * Handy Reminders,…



RECENT POSTS

 * Pricing Adjustments for TeamCity Integration for Jira June 30, 2022
 * Table Filter and Charts for Confluence Cloud Free for up to 10 Users June 2,
   2022
 * How to Organize Documentation for ISO Certification in Confluence April 29,
   2022

CATEGORIES

 * Atlassian Bamboo
 * Atlassian Bitbucket
 * Atlassian Confluence
 * Atlassian Jira
 * Atlassian Stash
 * Atlassian Stride
 * Case Study
 * Events
 * How To
 * Know StiltSoft team
 * News
 * Uncategorized

 * Twitter
 * Linkedin
 * YouTube

Copyright StiltSoft 2022. All rights reserved.
 * Most Popular Apps
 * All Apps on Marketplace
 * Get Help
 * Request Feature

Top