github link to wiki page from README

How do I create a link from a README.md file to a Wiki page in github? Every example seems to show linking from one wiki page to another wiki page, or from one README file to another file in the repository. But none that show linking from one to the other


Solution 1:

I just came across this question and saw that this was impossible, but stubbornly kept trying anyway. Good news, because this actually can be done with relative links!

If you look at the documentation for relative links on GitHub, you can see that it supports ./ and ../ operands.

Given that your README is located at:

https://github.com/<user-name>/<repo-name>/blob/master/README.md

... and the wiki is located at:

https://github.com/<user-name>/<repo-name>/wiki

... that means you can just crawl back from the README to the wiki, like so:

[My Awesome Wiki](../../wiki)


Update: As some people have pointed out in the comments (thanks!), please be aware that these relative links will break on clones and forks, so be sure to weigh that into your decision!

Solution 2:

You would have to use an absolute URL as opposed to a relative one.

For example:

[Sites Using React](https://github.com/facebook/react/wiki/Sites-Using-React)

Solution 3:

I found that I needed to crawl back 3 levels versus 2 levels as descreibed in jmar777's approach.

When I used

../../wiki

The link generated was https://github.com/<username>/blob/wiki

I needed to use:

../../../wiki

This generated https://github.com/<username>/wiki

Solution 4:

I am using GitLab. My link to my Wiki page looks like this.

Checkout the [Wiki page](/%2E%2E/wikis/Welcome)

I tried the other recommendations that are posted here but it kept changing the URL with re-writes that broke the link.

Solution 5:

Just to add on this one, if you want to refer to your repo file from inside wiki use ../../blob/master/. Combined with the answer from jmar777 this allows to completely integrate code and wiki and remove a need for bloated readme.md.

To make it work locally as well as your file structure would have to be

./Wiki/YourWikiRepo
./blob/master/YourCodeRepo