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
gcom() { | |
if [ -z "$1" ]; then | |
echo "Please provide a commit message." | |
else | |
branch_name=$(git symbolic-ref --short HEAD) | |
if [ $? -eq 0 ]; then | |
git commit -m "${branch_name}: $1" | |
else | |
echo "Not a git repository. You can create repo with git init" | |
fi |