github Readme - reference issue

How can I reference (insert a relative link to) an issue in my github Readme.md?

I found the following document GitHub Flavored Markdown where it is described how to reference to an issue in a commit, but not in the readme.

E.g. if the Issue is: https://github.com/user/project/issues/5 how can I set a link to it in my readme without using absolute links?


Solution 1:

There's a pretty ugly way of doing something like that if you only want to refer to issues from the same repo, which as of 2015-04-29 works:

see also [#3](/../../issues/3)

Solution 2:

This is not strictly the solution to your question, but maybe the solution to your problem.

I too wanted to avoid to add absolute URLs to links in my CHANGELOG, because it would make the lines so long and unreadable.

But when using reference style links, it's not too bad:

* [feature] Add an awesome feature ([#33][i33])
* [bug] Finally fixed this stupid bug ([#19][i19])

[i19]: https://github.com/user/repo/issues/19
[i33]: https://github.com/user/repo/issues/33

One of the big advantages is that it also works outside of Github.

Solution 3:

This is not (officially) possible. GitHub Flavored Markdown is not used for rendering markdown files in your repo, it is used only for issues and comments. So, readme files are rendered using normal markdown, and no autolinking will happen for issues, SHAs and similar constructs.