open ~/.gitconfig
[alias]
time = !git status | grep 'git push' && EDITOR='vim -c wq' git rebase -i --autostash -x 'git commit --amend --no-edit --reset-author' && echo "updated timestamps" || echo "nothing to rebase"
| #!/bin/bash | |
| FILE=$1 | |
| MESSAGE=$(cat $FILE) | |
| TICKET=$(git rev-parse --abbrev-ref HEAD | grep -Eo '^(\w+/)?(\w+[-_])?[0-9]+' | grep -Eo '(\w+[-])?[0-9]+' | tr "[:lower:]" "[:upper:]") | |
| if [[ $TICKET == "" || "$MESSAGE" == "$TICKET"* ]];then | |
| exit 0; | |
| fi | |
| echo "$TICKET: $MESSAGE" > $FILE |