Hi,
using the Bitbucket Rest API is there a way to get the list of files based on commit id?
rest/api/1.0/projects/{projectname}/repos/{reponame}/commits/{commit id}
is not returning the list of files
If you use the following REST API endpoint:
rest/api/1.0/projects/{projectname}/repos/{reponame}/commits/{commit id}/changes
The reply will contain (among other information) the details of each files modified in the commit.
As an example, this is the related section from the entire json output:
path: {
components: [
"file1.txt"
],
parent: "",
name: "file1.txt",
extension: "txt",
toString: "file1.txt"
},
Here the link to our REST API documentation:
- https://docs.atlassian.com/bitbucket-server/rest/latest/bitbucket-rest.html
Cheers,
Caterina - Atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a question related to above scenario. How can I get latest commit Id for a file from bitbucket rest api (not from UI)? We want to fetch the source commit Id for a file programmatically and use again to push updated content via bitbucket rest api
Basically i want rest api version of below command-
git log -n 1 --pretty=format:%H -- myfile
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.