Moving a GitHub Wiki

Related: Duplicating GitHub Wiki


GitHub Wikis are not accessible via GitHub API v4. We can use a couple simple Git command line statements to move a GitHub Wiki.

For these examples, we assume that:

  • old wiki https://github.com/username/repo1.wiki.git
  • new wiki https://github.com/username/repo2.wiki.git

Copy GitHub Wiki to your laptop:

git clone --bare https://github.com/username/repo1.wiki.git

Browse to new Wiki https://github.com/username/repo2/wiki and create blank Wiki

Mirror push Wiki to new repo:

git -C repo1 push --mirror https://github.com/username/repo2.wiki.git

Once you see the new Wiki https://github.com/username/repo2/wiki is OK, remove the old Wiki pages if desired:

git -C repo1 rm *.md

git -C repo1 commit -am "deleted old wiki pages"

git -C repo1 push