[Jan 11, 2021/Ready to ship] Deleting directories (#16901)
* Rename article * Do everything else * Fix filename typo * Add 💅 * Add beta note * Clarify beta note Co-authored-by: Meg Bird <megbird@github.com> * Remove beta note * Remove extra line * Add versioning * Rename article * Add redirect for almost name * Update file name * Fix link Co-authored-by: Meg Bird <megbird@github.com>
This commit is contained in:
@@ -14,7 +14,7 @@ versions:
|
||||
### Following the GitHub flow
|
||||
|
||||
1. [Create a branch](/articles/creating-and-deleting-branches-within-your-repository) from the repository.
|
||||
2. [Create](/articles/creating-new-files), [edit](/articles/editing-files), [rename](/articles/renaming-a-file), [move](/articles/moving-a-file-to-a-new-location), or [delete](/articles/deleting-files) files.
|
||||
2. [Create](/articles/creating-new-files), [edit](/articles/editing-files), [rename](/articles/renaming-a-file), [move](/articles/moving-a-file-to-a-new-location), or [delete](/github/managing-files-in-a-repository/deleting-files-in-a-repository) files.
|
||||
3. [Send a pull request](/articles/creating-a-pull-request) from your branch with your proposed changes to kick off a discussion.
|
||||
4. Make changes on your branch as needed. Your pull request will update automatically.
|
||||
5. [Merge the pull request](/articles/merging-a-pull-request) once the branch is ready to be merged.
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: Deleting files in a repository
|
||||
intro: 'You can delete an individual file{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} or an entire directory{% endif %} in your repository on {% data variables.product.product_name %}.'
|
||||
redirect_from:
|
||||
- /articles/deleting-files
|
||||
- /github/managing-files-in-a-repository/deleting-files
|
||||
- /github/managing-files-in-a-repository/deleting-a-file-or-directory
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
permissions: People with write permissions can delete files{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} or directories{% endif %} in a repository.
|
||||
---
|
||||
|
||||
### About file{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} and directory{% endif %} deletion
|
||||
|
||||
You can delete an individual file in your repository{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} or an entire directory, including all the files in the directory{% endif %}.
|
||||
|
||||
If you try to delete a file{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} or directory{% endif %} in a repository that you don’t have write permissions 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. For more information, see "[About pull requests](/github/collaborating-with-issues-and-pull-requests/about-pull-requests)."
|
||||
|
||||
If the file{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} or directory{% endif %} 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 "[Removing sensitive data from a repository](/github/authenticating-to-github/removing-sensitive-data-from-a-repository)."
|
||||
|
||||
### Deleting a file
|
||||
|
||||
1. Browse to the file in your repository that you want to delete.
|
||||
2. At the top of the file, click {% octicon "trashcan" aria-label="The trashcan icon" %}.
|
||||
{% data reusables.files.write_commit_message %}
|
||||
{% data reusables.files.choose-commit-email %}
|
||||
{% data reusables.files.choose_commit_branch %}
|
||||
{% data reusables.files.propose_file_change %}
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}
|
||||
### Deleting a directory
|
||||
|
||||
1. Browse to the directory in your repository that you want to delete.
|
||||
1. In the top-right corner, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %}, then click **Delete directory**.
|
||||

|
||||
1. Review the files you will delete.
|
||||
{% data reusables.files.write_commit_message %}
|
||||
{% data reusables.files.choose-commit-email %}
|
||||
{% data reusables.files.choose_commit_branch %}
|
||||
{% data reusables.files.propose_file_change %}
|
||||
{% endif %}
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
title: Deleting files
|
||||
intro: 'You can delete any file within your repositories on {% data variables.product.product_name %}.'
|
||||
redirect_from:
|
||||
- /articles/deleting-files
|
||||
versions:
|
||||
free-pro-team: '*'
|
||||
enterprise-server: '*'
|
||||
github-ae: '*'
|
||||
---
|
||||
|
||||
{% tip %}
|
||||
|
||||
**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](/articles/about-pull-requests) to the original repository after you commit your change.
|
||||
|
||||
{% endtip %}
|
||||
|
||||
1. Browse to the file in your repository that you want to delete.
|
||||
2. At the top of the file, click {% octicon "trashcan" aria-label="The trashcan icon" %}.
|
||||
{% data reusables.files.write_commit_message %}
|
||||
{% data reusables.files.choose-commit-email %}
|
||||
{% data reusables.files.choose_commit_branch %}
|
||||
{% data reusables.files.propose_file_change %}
|
||||
|
||||
{% danger %}
|
||||
|
||||
**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](/articles/removing-sensitive-data-from-a-repository).
|
||||
|
||||
{% enddanger %}
|
||||
@@ -21,7 +21,7 @@ versions:
|
||||
{% link_in_list /editing-files-in-your-repository %}
|
||||
{% link_in_list /editing-files-in-another-users-repository %}
|
||||
{% link_in_list /tracking-changes-in-a-file %}
|
||||
{% link_in_list /deleting-files %}
|
||||
{% link_in_list /deleting-files-in-a-repository %}
|
||||
{% link_in_list /renaming-a-file %}
|
||||
{% link_in_list /getting-permanent-links-to-files %}
|
||||
{% topic_link_in_list /managing-files-using-the-command-line %}
|
||||
|
||||
Reference in New Issue
Block a user