Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 403
phil Avatar asked Oct 20 '16 16:10

phil


People also ask

Why can't I push code to GitHub?

To push a branch on remote, your branch needs to have the latest changes present in remote repository. If you get the failed to push error, first do git pull the branch to get the latest commits and then push it.

How do I add a wiki to my GitHub repository?

Adding wiki pagesOn GitHub.com, navigate to the main page of the repository. Under your repository name, click Wiki. In the upper-right corner of the page, click New Page. Optionally, to write in a format other than Markdown, use the Edit mode drop-down menu, and click a different format.


1 Answers

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
like image 196
rafi wiener Avatar answered Sep 30 '22 18:09

rafi wiener