About file and directory deletion
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 "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 remove the file from GitHub Enterprise Server, you must remove the file from your repository's history. For more information, see "Removing sensitive data from a repository."
Deleting a file
-
Browse to the file in your repository that you want to delete.
-
At the top of the file, click .
-
在页面底部,输入一条简短、有意义的提交消息,描述您对文件所作的更改。 您可以在提交消息中将提交归于多个作者。 更多信息请参阅“创建有多个合作作者的提交”。
-
在提交消息字段下面,确定是要将提交添� 到当前分支还是新分支。 如果当前分支是默认分支,则应选择为提交创建新分支,然后创建拉取请求。 更多信息请参阅“创建新的拉取请求”。
-
单击 Propose file change(提议文件更改)。
Deleting a directory
-
Browse to the directory in your repository that you want to delete.
-
In the top-right corner, click , then click Delete directory.
-
Review the files you will delete.
-
在页面底部,输入一条简短、有意义的提交消息,描述您对文件所作的更改。 您可以在提交消息中将提交归于多个作者。 更多信息请参阅“创建有多个合作作者的提交”。
-
在提交消息字段下面,确定是要将提交添� 到当前分支还是新分支。 如果当前分支是默认分支,则应选择为提交创建新分支,然后创建拉取请求。 更多信息请参阅“创建新的拉取请求”。
-
单击 Propose file change(提议文件更改)。