Home > Mobile >  How do I make PR link after commit message?
How do I make PR link after commit message?

Time:05-05

enter image description here

This is a screenshot of gitmoji's folder structure. How do I make link to PR just like blue color of #number in this picture? I want to make this kind of link without using squash and merge!! I want to use original merge commit.

CodePudding user response:

If a commit message, issue, discussion or pull request comment has a # followed by a numver that's a valid pull request/issue/discussion id, it will automatically format it.

If you add #5 to your commit message and pull request #5 exists, GitHub will create a blue link to it.

CodePudding user response:

If you want to add PR number after your commit message

 You can search last PR number using git API:
    https://api.github.com/search/issues?q=sha:<sha-code>
  

it will give json output; PR is for example "number": 10,

Just do git log and paste sha code there of last commit and you will get the PR number of last commit. Your Current PR number: add 1 to it.

  • Related