span
span

Reputation: 5614

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

Upvotes: 6

Views: 2419

Answers (3)

emigenix
emigenix

Reputation: 201

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.

Upvotes: 2

VonC
VonC

Reputation: 1323125

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)

Upvotes: 0

Oleg
Oleg

Reputation: 531

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

Upvotes: 13

Related Questions