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

How to get a Bitbucket token to manage branches

Deleted user August 8, 2019

as part of my organization monthly git-maintenance we use the following command in a shell script to delete branches in bitbucket

 

curl -u id:password -H Content-Type:application/json https://bitbucket.organisation.com/rest/branch-utils/1.0/projects/projectname/repos/${REPO_NAME}/branches -X DELETE --data "{\"name\": \"refs/heads/${gitbranch}\",\"dryRun\": \"false\"}"

 

any idea how I can get a bitbucket token to delete as im not comfortable using my id:password in a script stored in out local servers.

 

Thanks !!

1 answer

1 accepted

0 votes
Answer accepted
Elifcan Cakmak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 8, 2019

Hello,

You can get a token by clicking on "Manage Account" on your profile picture on the upper right. There you can find "Personal access tokens" sections.

Regards.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events