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


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.


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

Share your software development horror stories!

Hey Community! I work on the Bitbucket product marketing team. With Halloween approaching, we wanted to discuss a topic tailor-made for October: development horror stories. Whether it was a lurk...

1,577 views 11 3
Join discussion

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