This version of GitHub Enterprise was discontinued on 2020-11-12. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Deleting files

You can delete any file within your repositories on GitHub Enterprise Server.

Tip: If you try to delete a file in a repository that you don’t have access to, we'll fork the project to your user account and help you send a pull request to the original repository after you commit your change.

  1. Browse to the file in your repository that you want to delete.

  2. At the top of the file, click .

  3. At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file. You can attribute the commit to more than one author in the commit message. For more information, see "Creating a commit with multiple co-authors."

    Commit message for your change

  4. Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current branch is the default branch, you should choose to create a new branch for your commit and then create a pull request. For more information, see "Creating a new pull request."

    Commit branch options

  5. Click Propose file change.

    Propose file change button

Attention: Since Git is a version control system, it always has your back if you need to recover the file later. If you really, really need to completely remove a file from a repository for some reason, such as a sensitive file that was accidentally committed, you should follow the steps in our article about removing sensitive data.