Use the documented auto-linking format for issues across repositories.
Syntax:{owner}/{repository}#{issue_number}
Example:mojombo/jekyll#1
When such formatted text is present in a commit message, it's automatically transformed into a clickable link which will redirect one to https://github.com/{owner}/{repository}/issues/{issue_number}
For linking to another repository, if you just paste the link to the issue or pull request, say https://github.com/{owner}/{repository}/issues/{issue_number}, GitHub will render it as