How to delete a file and folder from github.com repository using github.com's web interface? I searched on Google, but haven't found any answer.

I have found about how to do using commands

However I want to know how to do it using github.com.

  • There's definitely a way to edit files, but I'm not sure there's a way to delete them. Anyway, you might want the commands regardless. Learning git in the terminal or via a GUI will pay dividends. Aug 29 '12 at 13:00
  • This is a valid question, even for experienced Git users. I use git from the command line, but I just forked a repo, made a quick change, and now I'd like to remove a file that's no longer needed, without having to clone the repo on my own machine. Jan 31 '13 at 22:35
  • I added a solution that although not directly from GitHub (it's with prose.io), will deletes all the files and as an outcome will also remove the folder since it's empty. It's done with a script, so no need to manually remove multiple files. Jun 12 '18 at 21:15

You can delete a file using delete button but you cannot directly delete a folder via the web-interface. The way to delete a folder from GitHub.com is to delete every file inside it.


I've found that deleting all files in a folder will automatically delete the folder. Not a perfect solution, but it seems intended.


You have few options:

  1. Delete all the files from that folder and github will delete the folder automatically.
  2. Clone the repository in your local machine and delete the folder (for this you can use either git bash/cmd depending upon your system or github desktop application if installed in your system) and sync it back to the server.

You didn't specify your exact circumstances so this answer may not be what you want, but if you are using Windows you can install Github for Windows, which allows you to do all the regular Git operations without the command line.

You would need to first check out the repo to a folder, delete the file from the folder (i.e. in Windows Explorer), then commit your changes and sync back to the Github repo.

  • 3
    I’s say that using github.com's web interface is very exact. Your answer is correct, but it has nothing to do with the question.
    – Alex
    Aug 29 '12 at 15:46
  • That's fine, but the OP didn't really state what his problem was, only that he doesn't like the command line. In the same way that "how to parse HTML with regex" questions on SO are answered with "solve your problem a different way" my answer is an alternative method, on the off-chance it solves whatever problem he has. Clearly you are welcome to offer a better answer if there is one. Aug 29 '12 at 15:59
  • Actually, he did: “How to delete a file and folder from github.com repository using github.com's web interface?” He wants to delete a file using the web interface—the web site/web app/github.com.
    – Alex
    Aug 29 '12 at 16:31
  • No, he didn't. The title here is a question, not a problem. Plenty of people ask a question they think will solve their problem, but there is a better way to solve the problem. That may or may not be the case here, we'll have to wait for the OP to reply. Aug 30 '12 at 1:32

This functionality has now been added to the GitHub web interface.

enter image description here

  • 2
    Do you have any reference for this, like a blog post or screenshot of the desired functionality? Aug 2 '13 at 16:48
  • Sure, see the screenshot and after a bit of searching I found the blog entry too :-)
    – Dogsbody
    Aug 3 '13 at 23:54
  • This seems to relate to deleting files only – not deleting folders.
    – ms609
    Sep 26 '19 at 8:58
  • @ms609 folders don't really exist in git. They exist only hold files. Deleting (or moving) all the files in a folder deletes the folder automatically. You will see there is no way to create an empty folder in git
    – Dogsbody
    Sep 26 '19 at 13:12
  • True – but deleting a folder that contains 1000 files is nevertheless an arduous task if each file must be deleted individually.
    – ms609
    Sep 26 '19 at 15:17

Deleting folders from the Github web interface is not possible: https://github.com/isaacs/github/issues/225

It is on the feature list and will remain there for a while I guess.


I know it's not from GitHub's interface, but I hope this solution will fit. It does not require anything else than your browser and it solves the problem better than with just GitHub's interface.

The scripty way


  1. Connect your GitHub account to prose.io to manage your projects.
  2. Open the desired folder you wish to delete.
  3. Use this script [1]

What it does?

It iterates over the files in the current folder an deletes them. When there aren't any files in a certain folder - GitHub removes it.

var deleteSuccessful = 0, deleteFailed = 0;
var elements = $('a.delete');
var totalElements = elements.length;

function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));

async function deleteFiles() {
    for (var i = 0; i < totalElements; i++) {
        var element = elements[i];
        var realConfirm = window.confirm;
        window.confirm = function(){
            window.confirm = realConfirm;
            return true;
        try {
            deleteSuccessful += 1;
        } catch (error) {
            deleteFailed += 1;

        await sleep(1000);

    console.log("Total items identified: %d\nDeleted: %d\nFailed: %d\n** Operation %s **", 
        totalElements, deleteSuccessful, deleteFailed, totalElements == deleteSuccessful ? "successful" : "failed");


[1] You can either enter it in the browser console and run it, or minimize it and use it as a bookmarklet

Tested on Chrome 67.

Sources used: 1, 2


I have found an partial solution. We can delete file from github using http://prose.io but only files not folders

  • prose.io is the right answer as to how to delete a file from github through a web interface - it's not github's interface - but it totally works awesome. I was just looking for how to do this without going to the cryptic command line and it is perfect for the job :-D Apr 4 '13 at 21:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.