Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fi
- #!/bin/bash
- {
- # BRANCH="feature/AGS-62-agtrader-digital-ad-changes-for-d"
- BRANCH=$(git rev-parse --abbrev-ref HEAD 2>&1)
- } || {
- echo "Is not a git repository..."
- exit 1;
- }
- if [[ $BRANCH =~ ^[a-zA-Z]+\/([A-Z]+-[0-9]+)- ]]; then
- ISSUE_ID=${BASH_REMATCH[1]}
- else
- echo "Branch '$BRANCH' has no code in it."
- exit 1;
- fi
- MSG="${@:1}"
- git commit -m "[$ISSUE_ID] $MSG";
Add Comment
Please, Sign In to add comment