Created
August 28, 2024 15:23
-
-
Save mamad-1999/26b8a963e602e96172a892c6c333ca99 to your computer and use it in GitHub Desktop.
git commit Bash function
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
git-commit() { | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: git-commit <type> <message>" | |
return 1 | |
fi | |
local commit_type=$1 | |
local commit_message=$2 | |
git pull | |
git add . | |
git commit -m "$commit_type: $commit_message" | |
} | |
# Usage: git-commit "style" "change some style" | |
# Output in gitlog: style: change some style |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment