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

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

0 votes
Answer accepted
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events