Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fork GitHub project with custom wiki

Tags:

github

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 :(

like image 945
span Avatar asked May 28 '13 20:05

span


People also ask

Can you fork a GitHub Wiki?

You can't fork it directly on GitHub, but you can get Git access to it by going into the Git access tab of the wiki and you should be able to fork it on your local machine and edit it as much as you want (and even get updates to it!)

How do I fork a project on GitHub?

You can fork any repo by clicking the fork button in the upper right hand corner of a repo page. Click on the Fork button to fork any repo on github.com.

Is forking legal in GitHub?

The TOS states you agree to allow viewing and forking. It doesn't state that you agree to allow redistribution or use. If the terms don't explicitly state that you allow those things, then unless your license allows them they aren't allowed.

Can I fork a private repo?

You can fork it and it still remains private. Private collaborators may fork any private repository you've added them to without their own paid plan. Their forks do not count against your private repository quota.


2 Answers

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
like image 70
Oleg Avatar answered Oct 12 '22 10:10

Oleg


To clarify all the steps when using SSH.

git clone [email protected]:User1/Repo1.wiki.git
cd Repo1.wiki

# Now enable Wiki pages in Repo2

git remote add my-fork [email protected]: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:
# [email protected]/User2/Repo2.wiki.git

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

git config --local remote.my-fork.url [email protected]: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.

like image 35
emigenix Avatar answered Oct 12 '22 10:10

emigenix