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

How to delete a folder repository in source?

Nica
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2023

Good day!

 

I just wanted to ask how to delete directly a folder file in bitbucket instead of deleting it locally and commit push?

 

Since I'm encountering an issue during push I can't update the deleted file in my project, so I'm planning to delete the folder directly in the bitbucket. Do you have any ideas?

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 15, 2023

Hi @Nica and welcome to the community!

It is not possible to delete a folder directly in Bitbucket. The deletion needs to be done locally and then it needs to be committed and pushed.

Please keep in mind that this won't delete the folder or file from the previous commits. Deleting a folder or file from history would require rewriting history, e.g. with a tool like BFG repo cleaner. However, if you are not looking to remove it from history, then committing the deletion should be ok.

What issues are you facing when you try to push? What is the output of the push command? Perhaps we can help with that.

We also offer an API endpoint to create a commit that deletes files:

You can see an example below the line that reads "To create a commit that deletes files, use the files parameter:"

Kind regards,
Theodora

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 14, 2023

It doesn't matter where it is done, deleting a folder must be done with an actual commit!

But I think you're approaching it in the wrong way. Instead of trying to delete that folder for whatever reason, why don't you "git pull"? It would "sync" your local repo to the remote one,. It could even result in conflicts that you have to resolve, but it is the way to do it.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events