Skip to content

Prefill Commit Messages with Ticket Number from Branch for Intellij, PHPStorm, PyCharm, Webstorm, etc. ๐Ÿ”ฅ๐ŸŒถ๏ธ

Notifications You must be signed in to change notification settings

vincentrohde/intellij-ticketnr-prefill-commit-messsage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 

Repository files navigation

Intellij, PHPStorm, PyCharm, Webstorm, etc. - Prefill Commit Messages with Ticket Number from Branch

If you use Intellij, PHPStorm, PyCharm, Webstorm, etc. + a ticket system, this solution might be helpful for you, to spice up your commit messages ๐Ÿ”ฅ๐ŸŒถ๏ธ

You will install a custom Intellij plugin and use a regex. When you commit your changes, the commit message will be automatically prefilled with the ticket number you provided in your branch.

The solution supports the following branches. On the right you can see the result.

feature/#3444_test                          => #3444
#3444_test                                  => #3444
feature/#123-ABC_test                       => #123-ABC
feature/#123ABC-ABC123_test                 => #123ABC-ABC123
feature/#ABC-123_test                       => #ABC-123
bug/#ABC123-123_test                        => #ABC123-123
bug/#ABC123ABC-123_test                     => #ABC123ABC-123

Install plugin

https://plugins.jetbrains.com/plugin/14762-git-commit-message-template

IDE Settings

  • Open your Intellij Settings
  • Go to Other Settings | Git Commit Message Template
  • Go to Regex to extract info from branch
  • Select Custom and add the regex from below the image โฌ‡๏ธ

ticket-nr-commit-message

Regex

(\#[a-zA-Z0-9\-]+[a-zA-Z0-9]+)|(\#[0-9]+)

To complete your setup hit Apply, now you are ready to commit ๐Ÿš€

About

Prefill Commit Messages with Ticket Number from Branch for Intellij, PHPStorm, PyCharm, Webstorm, etc. ๐Ÿ”ฅ๐ŸŒถ๏ธ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published