On GitHub, can I fork just a wiki?

前端 未结 5 965
南旧
南旧 2020-12-25 12:02

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.

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-25 12:46

    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?)

提交回复
热议问题