Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 591
Stefan Profanter Avatar asked May 14 '13 09:05

Stefan Profanter


People also ask

How do I reference a GitHub issue?

You can reference issues between repositories by mentioning user/repository#number in an issue. Once we see something like that — say, github/enterprise#59 — we'll make sure to update issue #59 in github's enterprise repository and let you know where it was referenced from.

How do you cite a problem in a pull request?

Under your repository name, click Pull requests. In the list of pull requests, click the pull request that you'd like to link to an issue. In the right sidebar, in the "Development" section click . Click the issue you want to link to the pull request.

How do I reference a commit in issue?

Just include #xxx in your commit message to reference an issue without closing it.


2 Answers

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) 
like image 95
Eduardo Pareja Tobes Avatar answered Oct 08 '22 01:10

Eduardo Pareja Tobes


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.

like image 33
Danilo Bargen Avatar answered Oct 08 '22 00:10

Danilo Bargen