Created
July 21, 2017 01:52
-
-
Save joshluongo/b637e72d7531fc97164ead796897960a to your computer and use it in GitHub Desktop.
JIRA Git Commit/Push
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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