-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-commit.sh
More file actions
executable file
·33 lines (27 loc) · 805 Bytes
/
Copy pathgit-commit.sh
File metadata and controls
executable file
·33 lines (27 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Git commit script that prompts for GPG password
# Usage: ./git-commit.sh "Your commit message"
set -e
if [ -z "$1" ]; then
echo "Error: Commit message required"
echo "Usage: ./git-commit.sh \"Your commit message\""
exit 1
fi
COMMIT_MSG="$1"
echo "======================================"
echo "Git Commit with GPG Signing"
echo "======================================"
echo ""
echo "Commit message:"
echo "$COMMIT_MSG"
echo ""
echo "You will be prompted for your GPG password..."
echo ""
# Use --no-gpg-sign to skip GPG or remove this flag to enable GPG
# The GPG password prompt will appear in a GUI dialog
# --signoff adds "Signed-off-by: <email>" (required for DCO)
git commit --signoff -m "$COMMIT_MSG"
echo ""
echo "✓ Commit successful!"
echo ""
git log -1 --oneline