Donnerstag, 30. Januar 2014

Git Jira commit Message


It's easy to commit a jira task without entering the complete task title in the command line. Initially I wrote a simple script for my gender detection project that uses the jira api to fetch the required fields from the Jira server to generate a meaningful commit message but this script can simply be used for any other project.

Link to the script: https://github.com/markus-perl/git-jira-commit-message/blob/master/git-jira-commit-message

Edit the script and enter your credentials:
 #!/usr/bin/php
    <?php
    
    $username = 'Jira username';
    $password = 'jira password';
    $api = 'http://my.jira.url/rest/api/2/';

Now add the following line to the alias section in your .gitconfig file which is located in your home dir:

[alias]
  c = !sh -c 'git-jira-commit-message "$0"'


To commit a task just enter the task id. The script the title of the task to the commit message:

$ git c PR-1201

1 Kommentar: