42

If I fork repository joe/foo, and it has a Wiki, I won't get the wiki. Right now I'm just interested in forking the wiki to add pages to it.

  1. Is that possible without forking the repository?

  2. If not, is it possible at all?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Owen
  • 38,836
  • 14
  • 95
  • 125

5 Answers5

25

In June 2019, here's how I did that:

  1. Fork a repo. The wiki is not forked automatically. So your fork will have empty wiki.
  2. Create a wiki in the forked repo. Just create an empty Home page or whatever.
  3. Clone the git repo of original wiki: git clone https://github.com/org-a/project-x.wiki.git
  4. Assuming your forked repo now sits in https://github.com/org-b/project-x, add the new remote to the wiki repo: git remote add fork https://github.com/org-b/project-x.wiki.git
  5. Do the force push to overwrite your wiki with the original git push -f fork master

Great. Now you have forked a repo and its wiki.

(By the way, Github should do this automatically, right?)

gleb.pitsevich
  • 1,269
  • 2
  • 12
  • 18
  • 3
    So as a result, you have two separate repo: one for code and one for wiki, but you can't create a pull request for the wiki repo, can you? – mr NAE Feb 18 '20 at 11:26
  • 1
    No, I just did this only to discover there is no way to contribute my Wiki changes. WTF, Github? – kontextify Feb 15 '23 at 04:11
  • Well, does not work any more, because authentication does not work. you have to access the repo via SSH in order to be able to write to it from console. But access to WIKI.git only goes through HTTPS. Am I right or does anybody know a solution? – JPT Mar 12 '23 at 14:32
  • It works using HTTPS and personal access tokens as described here https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token – JPT Mar 12 '23 at 15:01
17

You can't fork it directly on GitHub, but you can get Git access to it by going into the Git access tab of the wiki and you should be able to fork it on your local machine and edit it as much as you want (and even get updates to it!)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Matt S.
  • 13,305
  • 15
  • 73
  • 129
5

You are able to just clone a Wiki from a repo now. You can find a tab called Git Access under Wiki tab of a repo.

But you still can not fork a wiki without forking its project repo.

dismory
  • 100
  • 2
  • 5
2

If you're making your own wiki that others would be interested in forking, you could do something like we did for the RailsConf 2012 wiki.

We made a local clone of the wiki and then did git push --force to the "code" repository. It gets a little out of sync, but that's easy to rectify.

Benjamin Oakes
  • 12,262
  • 12
  • 65
  • 83
-3

As of 30 March 2016, you can just create a new "Home" Wiki page and the wiki pages for the forked repository will show up in your fork once the new Home page is created (provided that you have forked the parent repository).

lesderid
  • 3,388
  • 8
  • 39
  • 65
Hubert P
  • 19
  • 1
  • Note that it will just say a 'Home' page already exists when you try creating one and pull in the wiki repository from the original project. It kinda looks like a bug to be honest. It just 'notices' there already is a wiki when you try to create a page. – lesderid Aug 04 '16 at 21:30
  • 6
    At the time of this comment, this answer doesn't work. The [About GitHub Wikis](https://help.github.com/articles/about-github-wikis/) page uses the [Netflix/Hystrix wiki](https://github.com/Netflix/Hystrix/wiki) as an example. I can access that repo and wiki. I forked the repo to my account. In my fork the wiki was empty, as expected. As this answer suggests, I created a "Home" wiki page. GitHub created it without comment/error. Afterwards, the wiki in my fork contained only the new Home page and no others. This answer is wrong. – Mr. Lance E Sloan Oct 14 '16 at 17:48