add git hooks for commit validation, auto-suggestions, and Docker build/push automation on git push
This commit is contained in:
17
.githooks/post-commit
Executable file
17
.githooks/post-commit
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Post-commit hook: show info after successful commit
|
||||
|
||||
COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||
COMMIT_MSG=$(git log -1 --pretty=%s)
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
echo ""
|
||||
echo "✅ Commit created: $COMMIT_HASH"
|
||||
echo "📝 Message: $COMMIT_MSG"
|
||||
echo "🌿 Branch: $BRANCH"
|
||||
echo ""
|
||||
|
||||
# Remind to push if needed
|
||||
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
|
||||
echo "💡 Tip: Run 'git push' to trigger deployment"
|
||||
fi
|
||||
Reference in New Issue
Block a user