Skip to content

Instantly share code, notes, and snippets.

@joshluongo
Created July 21, 2017 01:52
Show Gist options
  • Save joshluongo/b637e72d7531fc97164ead796897960a to your computer and use it in GitHub Desktop.
Save joshluongo/b637e72d7531fc97164ead796897960a to your computer and use it in GitHub Desktop.
JIRA Git Commit/Push
#!/bin/bash
# Get JIRA Project ID.
PROJECT_ROOT=`git rev-parse --show-toplevel`
JIRA_PREFIX=`cat "$PROJECT_ROOT/.jiraid"`
# Status
git status
# Get JIRA ID
echo -n "Enter the JIRA issue number [$JIRA_PREFIX]: "
read -e JIRAID
# Get Git Commit Message
echo -n "Enter the commit message: "
read -e COMMITMSG
# Add/Commit/Push
git add .
git commit -m "[$JIRA_PREFIX-$JIRAID] $COMMITMSG"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment