How to delete multiples files in Github

Is there a way to select all files and delete files in github at once? Currently I delete single file at time and commit changes.

I want to select multiple or all files and delete under a single commit.



Hi @naqvisn,

Thanks for being part of the GitHub Community Forum!

Your post was edited because it contained potentially sensitive information that you may not have intended to make public, such as your email address shared as a tag. We discourage users from sharing such information in our public forum, as it can create security and privacy risks for the poster, as well as other users.

If you want to share a repo with others in the Community Forum, we recommend sharing a link to the GitHub repo in which the project you are working on exists, rather than sharing an email address. 



Hi @naqvisn,

There isn’t a way to select multiple files for deletion using the Web UI at the moment, but I’ll let the team know you’d like us to add this feature in the future.

In the meantime, the way we recommend editing or deleting multiple files is by working with a local repository. You would then be able to delete the files in your local clone, commit that change to your local repository, and then push that change to the remote repository on GitHub.

The steps for doing this are:

  • In the command-line, navigate to your local repository.
  • Ensure you are in the default branch:
    git checkout master
  • The rm -r command will recursively remove your folder:
    git rm -r folder-name
  • Commit the change:
    git commit -m "Remove duplicated directory"
  • Push the change to your remote repository:
    git push origin master

I hope this helps!


        remove files in local

  • git rm <file1> <file2> <file3>…

       commit your chnages

  • git commit -m "removing files"

       push your chnages to github

  • git push

   you can refere here how to remove files from git-git remove untracked files


how do i open the command line?


One easy way: download and install git from “”. In windows explorer, go to the folder you want, right-click and run “Git bash here”. 

1 Like

Thank you brother


press Ctl+ALT+t to open a new terminal in Ubuntu

How do I delete multiple files using github desktop?


Thank you so much …

For those looking for a git solution (command line solution):

  1. Manually delete the files just like you would normally delete any file in windows. Right click the file(s) and click delete. 

  2. Type this command

    git add -u

You may go ahead and commit the change. 

1 Like

Thank you somuch

You may need to use:

git push -f origin master

How it worked for me:

➜ mfb-plm git:(master) git push origin master
 ! [rejected] master -> master (fetch first)
error: failed to push some refs to ''
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
➜ mfb-plm git:(master) **git push -f origin master** Enumerating objects: 383, done.
Counting objects: 100% (383/383), done.
Delta compression using up to 12 threads
Compressing objects: 100% (94/94), done.
Writing objects: 100% (383/383), 241.06 KiB | 80.35 MiB/s, done.
Total 383 (delta 238), reused 381 (delta 238)
remote: Resolving deltas: 100% (238/238), done.
 + a4a0df9...849eece master -> master (forced update)

Its deleting folder i want to delete inside folder file’s

1 Like

One Solution would be:

  1. “View” >> “Show in Explorer”.

  2. Make edits in your file explorer, and close.

  3. Commit Changes and/or Pull and Merge.


Thanks. It works.

Thanks. Appreciate the help.

It actually deleted the file too

thanks. But can you add these feautere to web UI? because this id going to be a simple way.

I get “fatal: pathspec … did not mach any files”, though files are added to GitHub when I add another directory.

I was studying to work ith git with GitBush, GitGUI, Intellij IDEA, TortoiseGit and, think, made some modifications, which I cannot get rid of now.
Any commit adds too many extra folders, which I can’t delete from git with your instructions.