Skip to content

Instantly share code, notes, and snippets.

@yallie
Forked from subfuzion/github-wiki-how-to.md
Created December 11, 2016 21:32
Show Gist options
  • Save yallie/e5ea4c6a56290ce0034b21bc9c1ed80c to your computer and use it in GitHub Desktop.
Save yallie/e5ea4c6a56290ce0034b21bc9c1ed80c to your computer and use it in GitHub Desktop.
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com/myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo.

How do I add images to a wiki page?

You need to clone the wiki repo and edit it on your system.

Add images to the images directory (or subdirectory below it). For example: images/project-architecture/project-architecture-overview.png.

In your wiki page markup, embed an image link in the following format:

[[/images/path/to/image.ext|ALT TEXT]]

(The leading / is so the path is still correct when editing a wiki page in subdirectory. You can't put pages in sub-directories when editing via the online editor, but you can when you work with clone repo.)

Commit and push your changes.

How do I add files to a wiki page?

You need to clone the wiki repo and edit it on your system.

Add files to the files directory (or subdirectory below it). For example: files/project-presentation.pdf`.

In your wiki page markup, add the file link in the following format:

[link text](files/path/to/file "ALT TEXT")

For example:

[Project Presentation](files/project-presentation.pdf "Project Presentation PDF")

Commit and push your changes.

See related references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment