i am trying to automate some task ,where i need to connect a bitbucket project and need to visit every repos and branches in each repos delete some content on the file present in every branches and commit the changes remotly using python script.
Hi Rijin and welcome to the community!
We have an API endpoint that can be used to create a commit in a remote repo by uploading a file (a file that exists on the computer where you run this API call):
If the file exists in the remote repo, its content will be replaced with the content of the file you are uploading. The branch can be specified the same way as the file, e.g. with curl you add -F branch=branch-name in the request.
The following API endpoints can be used for retrieving all repos in a workspace (that you have access to) and all open branches in a certain repo respectively:
Kind regards,
Theodora
If I were you I would do this Git:
You can do this using by running the Git commandline client from Python. The nicety is that you don't even need to tie yourself to Bitbucket, which means flexibility (you can migrate to any Git hosting platform in the future).
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.