The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I modify file and push to my branch by RestApi v2

Suhaib Baba
May 7, 2023

I'm trying to modify some files and push them to the `test` branch. I didn't find something in the documentation. can you please anyone tell me how can I do that? and can I push multiple files? (not I'm talking about Bitbucket rest APIv2, not Bitbucket server)

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Aron Gombas _Midori_
Community Champion
May 8, 2023

As you write about REST API, I guess you're trying to programatically push commits to a remote Bitbucket Cloud repo.

If so, then do NOT use the REST API for that!

Programatically clone the repo, then work on the local clone and push changes. You can use the git commandline client for that (or other client libraries that are available for all major programming languages). You would basically work with the Git tool in your program just like a human user.

Suhaib Baba
May 8, 2023

Thanks @Aron Gombas _Midori_ , BTW I found this documentation to do that

Push code to repo by Rest Api. It's very helpfull

Aron Gombas _Midori_
Community Champion
May 8, 2023

Oh, I didn't know about this approach. Interesting, thanks.

(I am not sure though if I used the REST API to do this if I had the option of using the Git client.)

Suhaib Baba
May 8, 2023

@Aron Gombas _Midori_ yes but if you have big projects and you need something to work on all of these projects like webhook. git clone will be very expinsive 

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events