Skip to content

Instantly share code, notes, and snippets.

@hacksalot
Created March 17, 2015 02:01
Show Gist options
  • Save hacksalot/72517b9b1c145116e89e to your computer and use it in GitHub Desktop.
Save hacksalot/72517b9b1c145116e89e 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
# Remove the .git folder.
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 <github-uri>
git push -u --force origin master
@omidgfx
Copy link

omidgfx commented Sep 27, 2017

How can I use this in windows, and I'm just started with github could you please help me on this ? is there any step-by-step guide ?

@Richienb
Copy link

To Use This On Windows Install Git Here Then You Can Execute The Commands In The Terminal

@Nyberg
Copy link

Nyberg commented Aug 24, 2018

This was really helpful. Thanks! ⭐

@r0ah
Copy link

r0ah commented Mar 4, 2019

Thanks! Very useful.

@robotsquidward
Copy link

Do GitHub wiki pages block force pushing to master by default? I'm unable to fast forward commit with this command in my GitHub wiki.

@MetalWorkerTools
Copy link

I also had problems pushing using: git push -u --force origin master
I seems you need a personal access token to login on the command line
https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

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