Mention remotes need resetting on removing-sensitive-data-from-a-repository.md (#43793)
Co-authored-by: Steve Guntrip <stevecat@github.com>
This commit is contained in:
@@ -125,11 +125,11 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
|
|||||||
Completely finished after 0.64 seconds.
|
Completely finished after 0.64 seconds.
|
||||||
```
|
```
|
||||||
|
|
||||||
{% note %}
|
{% note %}
|
||||||
|
|
||||||
**Note:** If the file with sensitive data used to exist at any other paths (because it was moved or renamed), you must run this command on those paths, as well.
|
**Note:** If the file with sensitive data used to exist at any other paths (because it was moved or renamed), you must run this command on those paths, as well.
|
||||||
|
|
||||||
{% endnote %}
|
{% endnote %}
|
||||||
|
|
||||||
1. Add your file with sensitive data to `.gitignore` to ensure that you don't accidentally commit it again.
|
1. Add your file with sensitive data to `.gitignore` to ensure that you don't accidentally commit it again.
|
||||||
|
|
||||||
@@ -142,7 +142,13 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
|
|||||||
```
|
```
|
||||||
|
|
||||||
1. Double-check that you've removed everything you wanted to from your repository's history, and that all of your branches are checked out.
|
1. Double-check that you've removed everything you wanted to from your repository's history, and that all of your branches are checked out.
|
||||||
1. Once you're happy with the state of your repository, force-push your local changes to overwrite your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}, as well as all the branches you've pushed up. A force push is required to remove sensitive data from your commit history.
|
1. The `git filter-repo` tool will automatically remove your configured remotes. Use the `git remote set-url` command to restore your remotes, replacing `OWNER` and `REPO` with your repository details. For more information, see "[AUTOTITLE](/get-started/getting-started-with-git/managing-remote-repositories#adding-a-remote-repository)."
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git remote add origin https://github.com/OWNER/REPOSITORY.git
|
||||||
|
```
|
||||||
|
|
||||||
|
1. Once you're happy with the state of your repository, and you have set the appropriate remote, force-push your local changes to overwrite your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}, as well as all the branches you've pushed up. A force push is required to remove sensitive data from your commit history.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ git push origin --force --all
|
$ git push origin --force --all
|
||||||
|
|||||||
Reference in New Issue
Block a user