Fork GitHub project with custom wiki

杀马特。学长 韩版系。学妹 提交于 2019-12-03 14:11:01

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

To clarify all the steps when using SSH.

git clone git@github.com:User1/Repo1.wiki.git
cd Repo1.wiki

# Now enable Wiki pages in Repo2

git remote add my-fork git@github.com:User2/Repo2.wiki.git

Pay attention to the use of : vs. / when using SSH. If something goes wrong here, you can't just repeat this command, so you need to manually change the url. To check what it is pointing to, use:

git config --local -l

# For example, this is wrong:
# remote.my-fork.url=git@github.com/User2/Repo2.wiki.git

If it is wrong, then set the correct URL with:

git config --local remote.my-fork.url git@github.com:User2/Repo2.wiki.git

Now you can continue with:

git push my-fork -f --no-tags

Where -f is shorthand for --force to overwrite all refs.

VonC

Update 2015/2016: you need to clone the wiki separately

And a wiki does not support pull request anyway.


2013 (Original answer): As illustrated by this project, a GitHub fork would clone:

So yes, you can fork and update the wiki without having to modify anything on the original upstream repo (the one you forked)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!