3aamsa
Last Updated: February 25, 2016
·
2.103K
· leemachin

Sync documentation between source and wiki on Github

git

You might have a doc folder in your project, full of documentation you maintain as you work on it.

You might also have a wiki on github with even more documentation, that isn't in the source (or documentation in the source that isn't in the wiki).

You can keep them in sync with Git, and Github is smart enough to know:

# change 'docs' at the end to whatever... or just omit it
git submodule add git@github.com:USER/REPO.wiki.git docs

Copy your other docs into the submodule repo, if you want, and then commit and push. Wiki updated!

You can't access the wiki repo directly, like you can your own. However, when you try to navigate to it in the source tree on Github, it'll take you straight to the wiki.

The end result is documentation that sits inside your working copy for offline reference, that can easily be synced with the wiki, and vice versa.

It also means potential users always see an up-to-date wiki, without having to clone the repo to get at the real documentation.

Say Thanks
Respond

3 Responses
Add your response

2867
Photo on 08.01.2013 at 04.15

Awesome idea!

over 1 year ago ·
5784
15927fc52919e9223adc7ed99e125d4d

This is also a great use case for the subtree alternative to Git Submodules (since submodules are often a pain during merge/rebase).
http://git-scm.com/book/en/Git-Tools-Subtree-Merging

git remote add docs git@github.com:USER/REPO.wiki.git
git fetch docs
git checkout -b docs docs/master
git read-tree --prefix=docs/ -u docs
over 1 year ago ·
15278
70e1167dbde5397557b0ec6fabb3d90a

@twolfson nice addition with a subtree example

over 1 year ago ·
Filed Under