Search code examples
githubwiki

Fork GitHub project with custom wiki


When forking a project on GitHub, the wiki is cloned from the original project.

Am I right to assume that I can make any changes (delete pages, edit pages) to my forked wiki without changing the upstream wiki?

I've searched Google, Stack Overflow and the GitHub documentation without finding information about this :(


Solution

  • Forking a GitHub project does not fork its wiki repo. A blank wiki is created instead in the fork, and any changes to it cannot be merged using pull requests. A workaround to this is to clone the GitHub wiki locally then push it into a separate repository, or a separate repository's wiki, e.g.:

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

    To keep the wikis in sync:

    git pull origin master
    git push my-fork master