Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github Commit Syntax to Link a Pull Request/ Issue

I've seen commit messages that refer to a specific issue / pull request. What is the syntax to include a specific repository's issue or pull request?

like image 401
AlbertEngelB Avatar asked Apr 11 '14 18:04

AlbertEngelB


People also ask

How do I reference a commit in issue?

You just need to include #xxx in your commit message to reference an issue without closing it. With the new GitHub issues 2.0, you can use these synonyms to reference an issue and close it (in your commit message).

How do you raise a pull request with one commit?

Go to either the git log or the GitHub UI and grab the unique commit hashes for each of the commits that you want. "Cherry pick" the commits you want into this branch. Run this command: git cherry-pick super-long-hash-here . That will pull just this commit into your current branch.


1 Answers

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}

like image 93
nulltoken Avatar answered Oct 08 '22 02:10

nulltoken