title | intro | redirect_from | versions | permissions | topics | shortTitle | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Deleting files in a repository |
You can delete an individual file or an entire directory in your repository on {% data variables.product.product_name %}. |
|
|
People with write permissions can delete files or directories in a repository. |
|
Delete files |
You can delete an individual file in your repository or an entire directory, including all the files in the directory.
If you try to delete a file or directory in a repository that you don’t have write permissions to, we'll fork the project to your personal account and help you send a pull request to the original repository after you commit your change. For more information, see "AUTOTITLE."
If the file or directory you deleted contains sensitive data, the data will still be available in the repository's Git history. To completely remove the file from {% data variables.product.product_name %}, you must remove the file from your repository's history. For more information, see "AUTOTITLE."
-
Browse to the file in your repository that you want to delete. {% ifversion code-view-ui %}
-
In the top-right corner, select the {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} dropdown menu, then click Delete file.
-
At the top of the file, click {% octicon "trash" aria-label="The trash icon" %}. {% endif %} {% data reusables.files.commit-message %} {% data reusables.files.choose-commit-email %} {% data reusables.files.choose_commit_branch %} {% data reusables.files.propose_file_change %}
-
Browse to the directory in your repository that you want to delete.
-
In the top-right corner, select the {% octicon "kebab-horizontal" aria-label="More options" %} dropdown menu, then click Delete directory.
-
Review the files you will delete. {% data reusables.files.commit-message %} {% data reusables.files.choose-commit-email %} {% data reusables.files.choose_commit_branch %} {% data reusables.files.propose_file_change %}