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.
I have set up automatic deployment in my repositories to deploy my PHP / Laravel applications.
Now I need to know how I can upload one * .yml file to my BitBucket repository and to a specific branch.
How can I do this? I am looking for an API that I can send via curl but cannot find a working solution.
Hello @Paweł Grzyb ,
Welcome to Atlassian Community!
My understanding is that you would like to commit a file to your repository for a given branch by using the Bitbucket API. If that is the case, you can use the Create a commit by uploading a file endpoint , as per the example below :
curl --user USERNAME:APP_PASSWORD https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/src \
-F /path/within_repo/my_test_file.txt=@local_file_to_be_commited.txt \
-F "message=This is the commit message" \
-F "author=Name <e-mail address>" \
-F "branch=my_branch"
For the authentication, you will need to provide your bitbucket username (not e-mail address) which you can find under your account's personal settings, along with an App Password (not the account password).
Also, the command above considers the file you are trying to upload (local_file_to_be_commited.txt) is in the same directory where you are executing the curl command.
You can try the above suggestion and let us know how it goes.
Thank you, @Paweł Grzyb .
Kind regards,
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.