Skip to content

Editing the wiki on your local machine

Phil Callender edited this page May 29, 2013 · 7 revisions

Github wikis are actually their own git repositories. If you go to a wiki page for your project on Github, you'll see menu items Home, Pages, Wiki History, and... Git Access. Click on that tab and you will see the URL for the wiki's github repo.

Note: you can't use submodules to create the github-wiki directory (see Phil's post here).

To set up the wiki for editing, clone it into a directory named github-wiki.

$ cd tea

$ ls -ld .git
drwxr-xr-x  16 philipcallender  staff  544 29 May 13:05 .git

$ git clone https://github.com/tooltwist/tea.wiki.git github-wiki
Cloning into 'github-wiki'...
remote: Counting objects: 49, done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 49 (delta 18), reused 4 (delta 0)
Unpacking objects: 100% (49/49), done.

IMPORTANT: Check that you have an entry for github-wiki in .gitignore. If you don't, then the contents of the wiki will get uploaded into your main project repository as well as the wiki repo.

$ cat .gitignore 
.DS_Store
/solr-4.3.0
/app/node_modules
/documentation/restapis/_site
/github-wiki
/github-pages
/solr
/memcached

Running the wiki locally

An tool named Gollum allows you to edit your wiki locally from a webserver running on your own machine, exactly the same as on Github.

To install Gollum:

$ sudo gem install gollum
Password:
Successfully installed gollum-2.4.13
1 gem installed
Installing ri documentation for gollum-2.4.13...
Installing RDoc documentation for gollum-2.4.13...

Run Gollum, and you'll be able to view and edit your wiki as on Github. Before you do this though, it's a good idea to pull the latest changes from github.

$ cd github-wiki
$ git pull
$ gollum

You can then access your wiki at http://localhost:4567. Once you finish, don't forget to commit and push any changes to github when you are finished.

$ git push

--

Clone this wiki locally