-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
43 lines (33 loc) · 711 Bytes
/
Copy pathdeploy.sh
File metadata and controls
43 lines (33 loc) · 711 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
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# ask for commit message
echo "Enter commit message:"
read message
# check if empty
if [ -z "$message" ]; then
echo "❌ Commit message cannot be empty"
exit 1
fi
# show files status
echo ""
git status
echo ""
# confirm push
echo "Do you want to commit and push? (y/n)"
read confirm
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
git add .
echo ""
echo "📦 Files and folders staged successfully."
git status
echo ""
echo "📝 Committing changes..."
git commit -m "$message"
echo ""
echo "🚀 Pushing code to remote repository..."
git push
echo ""
echo "✅ Code pushed successfully. Keep building 💪"
echo ""
else
echo "❌ Commit cancelled"
fi