Skip to content

Commit 5c9b0b1

Browse files
authored
Merge pull request #35408 from github/repo-sync
Repo sync
2 parents 2ba382d + db307a9 commit 5c9b0b1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md

+17
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,23 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
180180

181181
After using either the BFG tool or `git filter-repo` to remove the sensitive data and pushing your changes to {% data variables.product.product_name %}, you must take a few more steps to fully remove the data from {% data variables.product.product_name %}.
182182

183+
{% ifversion ghec %}
184+
1. If the repository was migrated using the {% data variables.product.prodname_importer_proper_name %}, there may be some non-standard Git references that follow the pattern `refs/github-services`, that neither the BFG tool or `git filter-repo` can remove. In this case, remove those references running the following commands in your local copy of the repository:
185+
186+
```shell
187+
# fetch all refs
188+
git ls-remote | grep refs/github-services | cut -f2 | sort -t'/' -k3,4n > github-services-refs.txt
189+
190+
# inspect and validate refs to be deleted
191+
cat github-services-refs.txt
192+
193+
# delete refs in batches
194+
export BATCH_SIZE=512
195+
cat github-services-refs.txt | xargs -n $BATCH_SIZE git push origin --delete
196+
```
197+
198+
{% endif %}
199+
183200
1. Contact {% data variables.contact.contact_support %}, and ask to remove cached views and references to the sensitive data in pull requests on {% data variables.product.product_name %}. Please provide the name of the repository and/or a link to the commit you need removed.{% ifversion ghes %} For more information about how site administrators can remove unreachable Git objects, see "[AUTOTITLE](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-repo-gc)." For more information about how site administrators can identify reachable commits, see "[Identifying reachable commits](#identifying-reachable-commits)."{% endif %}{% ifversion fpt or ghec %}
184201

185202
> [!IMPORTANT] {% data variables.contact.github_support %} won't remove non-sensitive data, and will only assist in the removal of sensitive data in cases where we determine that the risk can't be mitigated by rotating affected credentials.

0 commit comments

Comments
 (0)