Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 11

How to delete multiples files in Github

Solved! Go to Solution.

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.

 

Thanks

 

10 Replies
Moderator
Message 2 of 11

Re: How to delete multiples files in Github

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. 

Cheers!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Solution
Moderator
Message 3 of 11

Re: How to delete multiples files in Github

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!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Ground Controller Lvl 1
Message 4 of 11

Re: How to delete multiples files in Github

Thank you brother

Copilot Lvl 2
Message 5 of 11

Re: How to delete multiples files in Github

How do I delete multiple files using github desktop?

Ground Controller Lvl 1
Message 6 of 11

Re: How to delete multiples files in Github

Thank you so much ...
Ground Controller Lvl 1
Message 7 of 11

Re: How to delete multiples files in Github

        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

Highlighted
Ground Controller Lvl 1
Message 8 of 11

Re: How to delete multiples files in Github

how do i open the command line?

 

 

Ground Controller Lvl 1
Message 9 of 11

Re: How to delete multiples files in Github

One easy way: download and install git from "https://git-scm.com/download/win". In windows explorer, go to the folder you want, right-click and run "Git bash here". 

Ground Controller Lvl 2
Message 10 of 11

Re: How to delete multiples files in Github

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