1
0
mirror of synced 2025-12-19 18:10:59 -05:00

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:
Matt Rose
2023-10-04 15:18:33 +01:00
committed by GitHub
parent 3c3fc5dddd
commit 7ad05ae6ba

View File

@@ -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