Skip to content

Commit 9e1d0b6

Browse files
lecoursenmegbird
andauthored
[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>
1 parent 641ed02 commit 9e1d0b6

5 files changed

Lines changed: 45 additions & 31 deletions

File tree

33.1 KB
Loading

β€Žcontent/github/collaborating-with-issues-and-pull-requests/github-flow.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ versions:
1414
### Following the GitHub flow
1515

1616
1. [Create a branch](/articles/creating-and-deleting-branches-within-your-repository) from the repository.
17-
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.
17+
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.
1818
3. [Send a pull request](/articles/creating-a-pull-request) from your branch with your proposed changes to kick off a discussion.
1919
4. Make changes on your branch as needed. Your pull request will update automatically.
2020
5. [Merge the pull request](/articles/merging-a-pull-request) once the branch is ready to be merged.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Deleting files in a repository
3+
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 %}.'
4+
redirect_from:
5+
- /articles/deleting-files
6+
- /github/managing-files-in-a-repository/deleting-files
7+
- /github/managing-files-in-a-repository/deleting-a-file-or-directory
8+
versions:
9+
free-pro-team: '*'
10+
enterprise-server: '*'
11+
github-ae: '*'
12+
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.
13+
---
14+
15+
### About file{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} and directory{% endif %} deletion
16+
17+
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 %}.
18+
19+
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)."
20+
21+
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)."
22+
23+
### Deleting a file
24+
25+
1. Browse to the file in your repository that you want to delete.
26+
2. At the top of the file, click {% octicon "trashcan" aria-label="The trashcan icon" %}.
27+
{% data reusables.files.write_commit_message %}
28+
{% data reusables.files.choose-commit-email %}
29+
{% data reusables.files.choose_commit_branch %}
30+
{% data reusables.files.propose_file_change %}
31+
32+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}
33+
### Deleting a directory
34+
35+
1. Browse to the directory in your repository that you want to delete.
36+
1. In the top-right corner, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %}, then click **Delete directory**.
37+
![Button to delete a directory](/assets/images/help/repository/delete-directory-button.png)
38+
1. Review the files you will delete.
39+
{% data reusables.files.write_commit_message %}
40+
{% data reusables.files.choose-commit-email %}
41+
{% data reusables.files.choose_commit_branch %}
42+
{% data reusables.files.propose_file_change %}
43+
{% endif %}

β€Žcontent/github/managing-files-in-a-repository/deleting-files.mdβ€Ž

Lines changed: 0 additions & 29 deletions
This file was deleted.

β€Žcontent/github/managing-files-in-a-repository/index.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ versions:
2121
{% link_in_list /editing-files-in-your-repository %}
2222
{% link_in_list /editing-files-in-another-users-repository %}
2323
{% link_in_list /tracking-changes-in-a-file %}
24-
{% link_in_list /deleting-files %}
24+
{% link_in_list /deleting-files-in-a-repository %}
2525
{% link_in_list /renaming-a-file %}
2626
{% link_in_list /getting-permanent-links-to-files %}
2727
{% topic_link_in_list /managing-files-using-the-command-line %}

0 commit comments

Comments
Β (0)