-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush-to-prom2sar.sh
More file actions
executable file
·64 lines (51 loc) · 2.05 KB
/
Copy pathpush-to-prom2sar.sh
File metadata and controls
executable file
·64 lines (51 loc) · 2.05 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Push to your prom2sar repository
set -e
echo "════════════════════════════════════════════════════════════════════"
echo " Pushing to your prom2sar repository"
echo "════════════════════════════════════════════════════════════════════"
echo ""
# Get GitHub username
echo "What is your GitHub username?"
read -p "Username: " GITHUB_USER
if [ -z "$GITHUB_USER" ]; then
echo "❌ Error: Username cannot be empty"
exit 1
fi
echo ""
echo "Repository URL: https://github.com/${GITHUB_USER}/prom2sar"
echo ""
# Check if remote exists
if git remote | grep -q "^origin$"; then
echo "⚠️ Remote 'origin' already exists. Updating URL..."
git remote set-url origin "https://github.com/${GITHUB_USER}/prom2sar.git"
else
echo "Adding remote 'origin'..."
git remote add origin "https://github.com/${GITHUB_USER}/prom2sar.git"
fi
echo "✅ Remote configured"
echo ""
# Show what will be pushed
echo "Commits to push:"
git log --oneline
echo ""
# Confirm
read -p "Push to https://github.com/${GITHUB_USER}/prom2sar? (y/n) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Cancelled."
exit 0
fi
echo ""
echo "Pushing to GitHub..."
echo "(You may be prompted for credentials)"
echo ""
# Push
git push -u origin main
echo ""
echo "════════════════════════════════════════════════════════════════════"
echo " ✅ SUCCESS! Repository pushed to GitHub!"
echo "════════════════════════════════════════════════════════════════════"
echo ""
echo "View at: https://github.com/${GITHUB_USER}/prom2sar"
echo ""