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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,302
Community Members
 
Community Events
184
Community Groups

How can i get the list of files based on commit id

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

 

2 comments

Caterina _or Kate_ Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 22, 2018

Hi @visagan santhanam,

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

Like Gopika_Verma likes this

hi @Caterina _or Kate_ Curti  is there a way to do this with Bitbucket APIs 2.0?

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

 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events