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 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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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.

TAGS
AUG Leaders

Atlassian Community Events