Purge GitHub data

It is possible to remove certain public data without fully nuking your account.

Remove all gists

Create a PAT with read and write access to Gists.

Install the gists-gone CLI with pip(x):

pipx install gists-gone

Run via:

gists-gone --token <pat>

Unstar repos

Using a CLI

Create a PAT with Repository Metadata read and Account Starring write permissions. If that fails, use a classic access token with “repo” scope.

Run via:

bunx github-unstar

It will ask for a GitHub PAT.

Using JavaScript console in a browser

In case you are hit with rate limits after using the CLI, you can use the following script to auto-click “Unstar” buttons on all repos visible on the page.

const buttons = document.querySelectorAll(
  'button[data-aria-prefix="Starred, click to unstar this repository"]',
)

for (const btn of buttons) btn.click()

Reload the page and repeat the process until all repos are unstarred.

For starred topics use a different selector:

const buttons = document.querySelectorAll('button.starred')

for (const btn of buttons) btn.click()

Delete forks

TBD