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
Highlighted

Delete a script (source) from a branch in BitBucket

Good morning and happy Friday everyone. I've a question about BitBucket. I'm trying to delete a source from a shared branch, however after a few attempts and google searches, I couldn't find a solution for what I thought was relatively straightforward (could be I'm missing something very obvious like a drop down button or similar). Is anyone able to help? Thanks in advance

1 comment

Hello @Francesco Ciriachi,

What do you exactly mean by delete a source from a shared branch?

If this means deleting one (or few) file from that branch, you can do that in UI, single file at a time (make sure you selected the right branch in the dropdown at the top):

 mvnvm.properties — Bitbucket 2019-08-21 09-39-21.png

Note that every time you delete a file this way, a commit will be created on the branch in questions, that said the file you deleted will remain in the history of that branch.

If you need to remove more than one file, you might want to consider doing it in a single commit in your local copy of the repository, then pushing that commit to Bitbucket.

If you need to remove the file completely, i.e. not leave it in the history of your repository, you'll have to use history rewrite (assuming your repository is a Git one). This can only be done in your local copy of the repository, there're no tools for this in Bitbucket UI.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Comment

Log in or Sign up to comment
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 ...

1,505 views 0 6
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