GitHub: Using wiki locally: Error when making initial push to GitHub wiki

3.1k views Asked by At

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.

1

There are 1 answers

2
rafi wiener On

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