About deleting files and
directories
You can delete an individual file in your repository or an entire directory
, including all files in the directory
.
If you try to delete a file or directory in a repository for which you don’t have write permissions, 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 “About pull requests.”
If the file or directory you deleted contains sensitive data, the data will still be available in the repository’s Git history. To completely delete the file from GitHub, you must delete the history file from your repository. For more information, see
“Deleting sensitive data from a repository.”
Deleting
a file Locate
-
the repository file that you want to delete
-
the top of the file, click
-
Click Confirm changes…
-
Confirmation message” field, type a short, meaningful confirmation message that describes the change made to the file. You can attribute the commit to more than one author in the confirmation message. For more information, see “Creating a Multi-Author Commit.”
-
associated with your account in GitHub.com, click the Email Address drop-down menu and select the email address you want to use as the Git author email address. Only verified email addresses appear in this drop-down menu. If you enabled email address privacy, <username>@users.noreply.github.com is the confirmation author’s default email address. For more information, see “Confirm email address settings
.”
-
message fields, decide whether you want to add your confirmation to the current branch or to a new branch. If your current branch is the default branch, you must choose to create a new branch for confirmation, and then create a pull request. For more information, see “Creating a pull request.”
-
Click Propose File Change.
. At
.
In the “
If you have more than one email address
Under the confirmation
Delete a
directory Browse to
-
the repository directory that you want to delete
-
In the upper-right corner, select the drop-down menu, then click Delete directory
.
-
Review the files that you will delete.
-
Click Commit changes…
-
“Confirmation message” field, type a short, meaningful confirmation message that describes the change made to the file. You can attribute the commit to more than one author in the confirmation message. For more information, see “Creating a Multi-Author Commit.”
-
associated with your account in GitHub.com, click the Email Address drop-down menu and select the email address you want to use as the Git author email address. Only verified email addresses appear in this drop-down menu. If you enabled email address privacy, <username>@users.noreply.github.com is the confirmation author’s default email address. For more information, see “Confirm email address settings
.”
-
message fields, decide whether you want to add your confirmation to the current branch or to a new branch. If your current branch is the default branch, you must choose to create a new branch for confirmation, and then create a pull request. For more information, see “Creating a pull request.”
-
Click Propose File Change.
.
In the
If you have more than one email address
Under the confirmation