You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
The Create a commit by uploading a file endpoint doesn't return anything. I need the commit hash that it has created. Is there a workaround for this?
Hi @Jonathan Li!
With curl, it is possible to add the -v option, as follows:
curl -u BitbucketUsername:AppPassword -v https://api.bitbucket.org/2.0/repositories/workspace-id/repo/src \
-F myFile.txt=@myFile.txt
When the -v option is added, the output will return, among other things, a line that looks like this:
< location: https://api.bitbucket.org/2.0/repositories/workspace-id/repo/commit/361fbb45757afc4056a400730bd6cf6fe3e77c07
The last part is the commit hash of the commit created by the API call.
Kind regards,
Theodora
If it doesn't return it, maybe you could get the refs from the repo right after you created the commit. Because you know to which branch you created the commit, you need the hash of the head of that branch.
(You could even get the branch itself from the REST API, but as far as I saw it won't return the hash either?!)
Anyway, it should give you an idea.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.