Hi I want to create a default message from branch name. I know we can use hook to do this but I get some problem with grep function.
For exmaple, if our branch name is "test-1234-my-first-feature', how can I convert it into "[test-1234]"?
I think this is pure shell script question, can some help?
we can get branch and by this How to add Git's branch name to the commit message?
BRANCH=`git branch | grep '^\*' | cut -b3-`
FILE=`cat "$1"`
echo "$BRANCH $FILE" > "$1"