Skip to content

Instantly share code, notes, and snippets.

@flipeador
Last active May 8, 2026 09:08
Show Gist options
  • Select an option

  • Save flipeador/514d6c3173b0cc320d42e5af480ef7fc to your computer and use it in GitHub Desktop.

Select an option

Save flipeador/514d6c3173b0cc320d42e5af480ef7fc to your computer and use it in GitHub Desktop.
Clear GitHub Gist revisions history.
git checkout --orphan latest_branch
git add -A
git commit -am "commit"
git branch -D main
git branch -m main
git push -f origin main
@flipeador
Copy link
Copy Markdown
Author

flipeador commented Aug 6, 2024

Clear GitHub Gist revisions history.

  1. Navigate to your GitHub Gist page.
  2. Click the Embed ↓ button, select Clone via HTTPS, and copy the URL.
  3. Run git clone <URL> in the command prompt to clone the Gist repository.
  4. Run the above Git commands in the command prompt to clear the revisions history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment