Skip to content

Instantly share code, notes, and snippets.

@mamad-1999
Created August 28, 2024 15:23
Show Gist options
  • Save mamad-1999/26b8a963e602e96172a892c6c333ca99 to your computer and use it in GitHub Desktop.
Save mamad-1999/26b8a963e602e96172a892c6c333ca99 to your computer and use it in GitHub Desktop.
git commit Bash function
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