Merge branch 'main' of github.com:github/docs-internal into remove-fpt
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 %}
|
||||
|
||||
@@ -127,7 +127,8 @@ In addition to managing organization-level settings, organization owners have ad
|
||||
| [Convert issues to discussions in bulk](/discussions/managing-discussions-for-your-community/managing-discussions-in-your-repository) | | | **X** | **X** | **X** |
|
||||
| [Lock and unlock discussions](/discussions/managing-discussions-for-your-community/moderating-discussions) | | **X** | **X** | **X** | **X** |
|
||||
| [Individually convert issues to discussions](/discussions/managing-discussions-for-your-community/moderating-discussions) | | **X** | **X** | **X** | **X** |
|
||||
| [Create new discussions and comment on existing discussions](/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion) | **X** | **X** | **X** | **X** | **X** |{% endif %}
|
||||
| [Create new discussions and comment on existing discussions](/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion) | **X** | **X** | **X** | **X** | **X** |
|
||||
| [Delete a discussion](/discussions/managing-discussions-for-your-community/managing-discussions-in-your-repository#deleting-a-discussion) | | | | **X** | **X** |{% endif %}
|
||||
|
||||
### Further reading
|
||||
|
||||
|
||||
@@ -39,20 +39,20 @@ You can use the `git show` command with the `--pretty=fuller` flag to check if t
|
||||
$ git show <em>Your commit SHA number</em> --pretty=fuller
|
||||
commit <em>Your commit SHA number</em>
|
||||
Author: octocat <em>user email</em>
|
||||
AuthorDate: Wed Jul 13 02:02:30 2016 +0900
|
||||
AuthorDate: Tue Apr 03 02:02:30 2018 +0900
|
||||
Commit: Sally Johnson <em>user email</em>
|
||||
CommitDate: Wed Jul 20 06:25:08 2016 +0900
|
||||
CommitDate: Tue Apr 10 06:25:08 2018 +0900
|
||||
```
|
||||
|
||||
If the author and commit date are different, you can manually change the commit date in the URL to see the commit details.
|
||||
|
||||
For example:
|
||||
- This URL uses the author date of `2016-07-13`:
|
||||
- This URL uses the author date of `2018-04-03`:
|
||||
|
||||
`https://github.com/your-organization-or-personal-account/your-repository/commits?author=octocat&since=2016-07-13T00:00:00Z&until=2016-07-13T23:59:59Z`
|
||||
- This URL uses the commit date of `2016-07-19`:
|
||||
`https://github.com/your-organization-or-personal-account/your-repository/commits?author=octocat&since=2018-04-03T00:00:00Z&until=2018-04-03T23:59:59Z`
|
||||
- This URL uses the commit date of `2018-04-10`:
|
||||
|
||||
`https://github.com/your-organization-or-personal-account/your-repository/commits?author=octocat&since=2016-07-19T00:00:00Z&until=2016-07-19T23:59:59Z`
|
||||
`https://github.com/your-organization-or-personal-account/your-repository/commits?author=octocat&since=2018-04-10T00:00:00Z&until=2018-04-10T23:59:59Z`
|
||||
|
||||
When you open the URL with the modified commit date, you can see the commit details.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user