How to delete files in github using the web interface

后端 未结 4 383
攒了一身酷
攒了一身酷 2021-02-03 20:57

The title pretty much is the question. I am aware of git rm file but this isn\'t what I am looking for. I am looking for a way to delete files and folders in a gith

相关标签:
4条回答
  • 2021-02-03 21:15

    You can't delete folders with a browser, but you can with the desktop app. Clone the repo to a directory, delete the folder there, and commit the change with the app.

    0 讨论(0)
  • 2021-02-03 21:17

    Delete all files within a folder. Folders are deleted automatically if there is no file in it anymore.

    0 讨论(0)
  • 2021-02-03 21:38

    This is not (yet?) available through the web interface.

    As GitHub added File editing, then File creation features, this may make sense to propose such a feature. The recommended channel to do so is to send an email to support@github.com.

    Update

    Deletion of files through the web interface is now available.

    screenshot

    0 讨论(0)
  • 2021-02-03 21:42

    There isn't a way to select multiple files for deletion using the Web UI at the moment.

    In the meantime, the way GitHub 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!

    0 讨论(0)
提交回复
热议问题