It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get a Bitbucket token to manage branches

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 Community Leader Aug 08, 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
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

662 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you