Do you know how to programmatically get Git commits?

Last updated by Brady Stroud [SSW] 8 months ago.See history

Using the Azure DevOps API you can programmatically get a list of commits from your repository with only a HTTP request.

devops get commits
Figure: HTTPS GET commits from your repository

Using HTTPS with basic authentication, make a GET request to a URL as below, substituting in your project details. A JSON object will be returned. To quickly create classes from a JSON response, see the rule Do you know how to easily get classes from a JSON response?

8 08 2014 4 24 34 PM compressor
Figure: Using the Chrome extension Postman to execute our request with Basic Authentication

For a C# implementation, see this blog post Getting Git Commits with the VSO REST API.


Drew Robson
We open source.Loving SSW Rules? Star us on GitHub. Star
Stand by... we're migrating this site to TinaCMS