Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Searching Commits in Bitbucket

With its user-friendly interface and functionality, Bitbucket has significantly enhanced the development workflow of teams and organizations that use Git. However, sometimes it can be hard to deal with commits. Have you ever squandered time scrolling the mouse wheel looking for old commits? Fortunately, there are certain things you can do to make things easy.

Of course, third-party solutions like Sourcetree or Awesome Graphs for Bitbucket can help you search for commits effectively. You can also use Bitbucket REST API, Awesome Graphs REST API, and the Export to CSV feature.

But first things first.

Sourcetree

Sourcetree is a free client for Windows and Mac that helps you to work with Git and Mercurial repositories. It allows you to look for commits made by a specific author, as well as commit messages and files.

Sourcetree search opportunities.png

To look at all commits for all repositories, you will need to go to each one manually. You have to install it for each device and remember that it doesn't support Linux.

Search for commits via REST API

Use this request to obtain all commits in the repository.

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

You can add more parameters to get more detailed information.

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"
                }
            ]
        },

You can also 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.

Awesome Graphs for Bitbucket

With the help of Awesome Graphs for Bitbucket, tech teams can improve and optimize their processes, getting insights into the code review process. Among other things, they can easily search for commits since it indexes commit content, making it easier to search by author, time, or repository. The app provides you with a wide set of graphs based on your requirements.

You can use the Contributions graph to look for all the commits made by a person in all projects and repositories, filtering them by required time period, project, or repository.

Contributions graph.png

Here is the activity stream with all commits.

activity-stream.png

Take advantage of the Activity graph to locate all commits to a specific repository.

Activity.png

The Top Committers Report is a lifesaver when you want to search for the old commits. This report locates the most active contributors. However, you can set the required period and select the authors of the commits you are looking for.

Top Committers Report.png

Export commit data to CSV

You can also export commit data to CSV and get a list with detailed information.

commits-export-1.png

To directly export raw commit data to CSV from Bitbucket, go to the People tab and export commit data choosing CSV.

people-csv.png

You can also use Awesome Graphs REST API.

Options to choose from

We've highlighted different solutions that can help you manage commits:

  • You can take advantage of Sourcetree when you work with a limited number of repositories.
  • Use the Awesome Graphs for Bitbucket app when you need a more comprehensive approach to search and analytics in Bitbucket.
  • Get the list of commits in the repository with the help of Bitbucket REST API.

Tell us about your way of searching commits. Feel free to ask us any questions you have.

0 comments

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Marketplace Apps & Integrations

☕️ Monday coffee with Jexo: Weekly Atlassian news roundup | 21st June 2021

Hi community 👋, as every Monday we're bringing you a quick update on what happened in the Atlassian ecosystem last week. There were a few interesting events like for example the announcement of th...

56 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you