How to integrate a GitHub wiki into the main project

Fabian Jakobs picture Fabian Jakobs · Aug 4, 2011 · Viewed 8.9k times · Source

I want keep all my source code and documentation in one single git repository. I already have the github pages integrated into my main project and now I want to do the same with the github wiki.

I know that github wikis are plain git repositories. My plan is to add the wiki as a remote to my main repo and keep everything in one place. However in the wiki repo everything is in the root directory and thus would clutter my main project.

Has anyone tried this before? What is the best way to handle this?

Answer

shelhamer picture shelhamer · Aug 4, 2011

You want to add the wiki as a submodule. Same Wiki git repo connected as a remote, but within a subdirectory with its own .git dir.

git submodule add git://github.com/you/proj.wiki

In the root of your main repo to add the wiki repo as a submodule in the wiki/ dir.