3. Create the hook file "prepare-commit-msg" inside the hooks folders and then place the following code inside it:
#!/bin/bash
orig_msg_file="$1"
temp="temp_message"
branch=$( git branch | grep '^\*' | cut -b3- )
task=$( sed -E "s/feature\/|hotfix\/|react\///g" <<< "$branch" )
echo "${task}: " >> "${temp}"
cat "${orig_msg_file}" >> "${temp}"
echo "$(sed '/^\s*$/d' "${temp}")" > "${orig_msg_file}"
rm "${temp}"
git config --global init.templatedir 'path_to_git_template_folder'
OBS: After this configuration every new git repository will include your hook, if you want already created repositories to also have this hook, then you need to reinitialize the repository, you can do this executing the following command inside the repository:
git init