12

I searched this problem many times, but still cannot resolve it.

Say, I fork a repo (let's name it repo1) from user1, and now I would like to fork the Wiki section of that repo as well, which GitHub won't do for you when you fork the repo.

I tried these commands:

git clone https://github.com/user1/repo1.wiki.git
git remote add my-fork https://github.com/myid/repo1.wiki.git
git push my-fork master

but the terminal prints:

fatal: remote error: access denied or repository not exported: /3/nw/32/2b/9e/135236793/71478887.wiki.git

which means that I cannot successfully push this local wiki to the Wiki section of my forked repo.

Does anyone have ideas about what's wrong here?
Thanks.

asm0dey
  • 2,841
  • 2
  • 20
  • 33
phil
  • 171
  • 2
  • 8

1 Answers1

15

You need to create the wiki first in your GitHub repository:

  1. Open the following URL in your browser:

    https://github.com/myid/repo1/wiki
    
  2. Press Create the first page and then Save Page buttons:

    How to create a wiki

Now you can push (the first push should be with -f option):

git push -f my-fork
EvgenKo423
  • 2,256
  • 2
  • 16
  • 23
rafi wiener
  • 587
  • 1
  • 9
  • 19
  • 2
    I submitted a github support request to add this info to [github's support page on working with the wiki from the command-line](https://help.github.com/articles/adding-and-editing-wiki-pages-locally/) as it makes no mention of needing to first bootstrap the wiki page via their web interface. – user3183018 Dec 24 '18 at 11:44
  • I opened a [PR](https://github.com/github/docs/pull/16468) to add this to the Github wiki docs. – Zach Valenta Mar 22 '22 at 23:50