I'm new to GitHub. When I clicked a Wiki
link a new Wiki was created for my repo. But I don't really need it. If I try to delete its only page, GitHub asks: "Are you sure you want to delete this page?". And I confirm that. And nothing happens, the page is still there. I can't say it's too annoying, but I'd like to know if there is a way to delete Wiki.

- 9,414
- 13
- 50
- 69
-
See: https://stackoverflow.com/a/42653762/4215651 – MAChitgarha Jan 08 '19 at 13:21
5 Answers
Click on the Settings button on the GitHub page of your project and uncheck Wikis.
It should disappear.

- 289,723
- 53
- 439
- 496
-
GitHub is pretty polished when it comes to interface, so things like that aren't too complex. – Blender Mar 18 '12 at 23:28
-
3
-
17Actually this only makes the Wiki invisible. It doesn't actually delete it. If you come back to the admin page and click on the wiki checkbox there, the contents will once again be visible. [via](http://stackoverflow.com/a/13447204/1485952) – fnkr Nov 21 '14 at 08:29
-
@fnkr is correct. In fact, if you have checked out your wiki somewhere, you can still push to it! You can also access some non-markdown files if you can guess the raw.githubusercontent.com url... – daveloyall Dec 31 '15 at 20:57
-
It disappears, but it does not delete it. It just deletes it as a menu option. – Xonatron Aug 08 '20 at 20:29
The missing bits are on GitHub as always. Combined with the usual git
-fu you can erase all data on a GitHub repo, for example destroy a wiki ACCOUNT/REPO.wiki.git
:
git clone git@github.com:ACCOUNT/REPO.wiki.git
cd REPO.wiki
git checkout --orphan empty
git rm --cached -r .
git commit --allow-empty -m 'wiki deleted'
git push origin empty:master --force
Warning! This recipe allows to really destroy all data (on any repo) on GitHub, except for what may be still cached somewhere. My test shows that even
git clone --mirror git@github.com:ACCOUNT/REPO.wiki.git
cannot bring back any trace of old data afterwards. BTW learning to understand what above does is a good exercise in learning git
;)

- 9,583
- 5
- 55
- 60
-
1Please note that you, probably, need to delete all other branches and tags, except `master`. Also note that you can protect branches on GitHub in `Settings`. Such a protected branch refuses to get something pushed with `--force`. So be sure to unprotect the branches in question, too. – Tino Aug 23 '17 at 12:14
First, discover your repo's URL:
$ cd your-project
$ git remote -v
origin git@github.com:belden/foo.git (fetch)
origin git@github.com:belden/foo.git (push)
Clone your wiki; its URL is your project's URL, ending with 'wiki.git':
$ cd /tmp
$ git clone git@github.com:belden/foo.wiki.git foo-wiki
Cloning into 'foo-wiki'...
remote: Counting objects: 375, done.
remote: Compressing objects: 100% (159/159), done.
remote: Total 375 (delta 214), reused 375 (delta 214)
Receiving objects: 100% (375/375), 78.41 KiB, done.
Resolving deltas: 100% (214/214), done.
Now just treat it like a normal project that you want to delete files from:
$ cd foo-wiki
$ git rm *.md
$ git commit -am "remove wiki pages"
$ git push
And you're done.

- 260
- 2
- 5
-
This keeps the full history, such that you can bring back the old contents of the Wiki if you like (see `git log`). If you want the history to be erased, too, see my variant. (`git` won't let you kill the history without `git push --force`, so if you leave away `--force` you are on the safe side in that respect) – Tino Oct 27 '16 at 10:10
The easiest way I found is the following:
git clone git@github.com:$USER/$REPO.wiki
cd $USER/$REPO.wiki
git push origin --delete master
Then uncheck "Wikis" from "Settings" -> "Features".

- 2,976
- 6
- 29
- 47
-
2This should be considered the accepted answer. Too bad it came so late. – Adrian Jan 03 '20 at 13:47
-
no clone needed: `git push git@github.com:$USER/$REPO.wiki --delete master` – Andrei Neculau Sep 09 '21 at 15:15
Deleting the wiki may also be necessary if you're moving from a paid private tier (which allows wikis on private repos) to the free tier (which doesn't).
Note that you can only disable Wikis (using the checkbox on the Settings page) on unarchived repos - archived repos don't have that option; to do so on them you'll have to temporarily un-archive them.
If you wish to preserve the content, one good option is to clone the wiki-repo the normal way:
git clone git@github.com:OWNER/REPO.wiki.git
and then go make a new repo named REPO-wiki on github. Then you can just edit your REPO.wiki/.git/config
file and change one character in the url =
under [remote "origin"]
from REPO.wiki
to REPO-wiki
.

- 41,842
- 6
- 48
- 60