How to delete a file/folder from Bitbucket repository?

Hi, I'm a Bitbucket noob and having a hard time getting started.

I'm trying to clean up the Bitbucket repository and my local git folder master and branch organisation.

My local computer's git folder has some folders deleted via Terminal $ rm -r folderName > $ git push.

Bitbucket repository still shows the folderName. How do I remove this?

I think part of the mess started with my local machine git cloning to the git folder which was in branch status and not master status?

7 answers

1 accepted

Ok, I figured out how to do it.

It seems you can't delete a remote file from a local command.

I went to the remote repository's website > Source > select branch > select folder > select file to be deleted > Edit > Delete > Commit.

I have an issue
I can delete a file parsable by Bitbucket (text, image, ...)
But for the others files (exe, ...) I can not delete it. When I click on the file, my browser download it

Thank you for the reply. The links are easy to read which is a nice improvement for IT documentation.

My issue isn't about deleting a branch however.
The issue is folder/s in the remote Master and a folder in the remote branch that won't delete.
I have deleted files locally and remotely in Master and Branch, but not the folders.

I think I'm misunderstanding how the Master and Branch works.
I have pulled the remote Master and then created a Branch locally. I then pushed the local Master and local Branch to the remote repository.
I'm confused on where the local folder is for my local Master and local Branch?
I have a git working folder/directory, but in there the folders 'magically' appear and disappear when I change to local Master or local Branch via Terminal?
I would like to always have access to seeing my local folders' Master or Branch, regardless of whether I'm in Terminal local Master or local Branch.

I have now deleted all files within the master folder named webpage.

However one remaining hidden file won't delete, named: .DS_Store

I think this is stopping the folder webpage being deleted?

Well, maybe the remote repository was slow or I made a mistake.

It seems the folders are now deleted so I can work with a cleanly organised local and remote repository now. See how it goes over the next few weeks.

I have the same problem again about deleting a file off the Bitbucket online remote repository.

I made a local file with the wrong name and pushed it up to the Bitbucket online remote repository.

I have now renamed the wrong named file on my local computer and deleted the wrongly named file.

I then typed $ git add fileWithWrongName.* fileWithCorrectName.* > Enter > $ git commit -m "Deleting wrongly named file and adding new correct named file on Bitbucket online remote repository." > Enter > $ git push > Enter > $ <Bitbucket password> > Enter.

The new file fileWithCorrectName.* was pushed up successfully to the Bitbucket online remote repository, however the fileWithWrongName.* didn't delete/remove from the Bitbucket online remote repository?

Any suggestions please?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

649 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot