Skip to content

Instantly share code, notes, and snippets.

@bz31
Forked from hacksalot/gist:72517b9b1c145116e89e
Last active February 24, 2024 03:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bz31/c1d1f2941eb5f6b0eeac8ef7ec78a281 to your computer and use it in GitHub Desktop.
Save bz31/c1d1f2941eb5f6b0eeac8ef7ec78a281 to your computer and use it in GitHub Desktop.
Delete GitHub wiki revisions
# Delete prior revisions from a GitHub wiki so that only the most-recent
# version of the content is available.
# Clone the wiki.
git clone https://github.com/[user]/[repo].wiki.git
# Example: git clone https://github.com/bz31/Buildroot.wiki.git
# Remove the .git folder.
cd [repo].wiki
rm -rf .git
# Reconstruct the local repo with only latest content
git init
git add .
git commit -m "Initial commit"
# Push to GitHub
git remote add origin https://github.com/[user]/[repo].wiki.git
git push -u --force origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment