As part of our projects' lifecycles, a few months ago we transferred two Github repositories from our organization to our client's own organization, for them to keep working on the project after our contract ended. That's business as usual, and wasn't that notesworthy - except the target organization was a free one, that doesn't support wikis, and we forgot we had documented some stuff in there.

A couple of weeks after that, the client asked us to help with some more work on the project, and we realize there's some missing docs we needed. Github did warn us that the wiki was to be lost upon transfer, but I incorrectly assumed there was no content in there (yes, I should have checked).

We were able to complete the tasks we needed anyway, since it wasn't that long since the project had ended - people still kind of remembered what they needed to do, and they started to re-write the docs as they performed their thing.

But then Johannes asked - have you checked if it's recoverable?

Contacting Github support could have been an option, but we first tried to hack our way out. We knew that Github wikis are git repositories (you can git clone them), and that their URLs are a function of the repo's base URL. So, for example, Crystal's compiler repo is at https://github.com/crystal-lang/crystal/ - so its wiki's web UI is at https://github.com/crystal-lang/crystal/wiki, and there it says you can git clone https://github.com/crystal-lang/crystal.wiki.git.

In our case, we knew the repo was at https://github.com/___A_FREE_ORGA___/some-repo, so Johannes manually crafted the URLs in which the wiki would have been if it still existed: https://github.com/___A_FREE_ORGA___/some-repo/wiki yielded a warning stating you have to upgrade your account for the wiki to work, but then we tried git clone https://github.com/___A_FREE_ORGA___/some-repo.wiki.git and... It worked!

We now have our own internal copies of those repos in our @manastech orga1, and we were able to restore the wikis there by pushing them to the "new" remotes:

$ git clone https://github.com/___A_FREE_ORGA___/some-repo.wiki.git
$ cd some-repo.wiki
$ git remote add fork https://github.com/manastech/some-repo.wiki.git
$ git push fork

I don't think this is supported behaviour - it's either probably Github overlooking this limitation, or a cache that hasn't been yet invalidated maybe. But it saved us, and I hope it saves you if needed.


  1. In hindsight, instead of transferring the repo, we should probably have used Github Importer to make a copy of the repo on the client's orga to avoid these issues, and link rot and stuff.