-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush_to_github.sh
More file actions
executable file
·58 lines (50 loc) · 1.67 KB
/
Copy pathpush_to_github.sh
File metadata and controls
executable file
·58 lines (50 loc) · 1.67 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
#!/bin/bash
# Script to push SproutUI code to GitHub repository
# Repository: https://github.com/JoeySCT/Sprout-WRO25.git
echo "==========================================="
echo " SproutUI GitHub Push Script"
echo " Repository: Sprout-WRO25"
echo "==========================================="
echo ""
# Check if we're in the right directory
if [ ! -d "sprout-ui" ] || [ ! -d "sprout-ui-english" ]; then
echo "Error: This script must be run from the SproutUI directory"
exit 1
fi
# Check git status
echo "Checking git status..."
git status -s
echo ""
echo "Local commits to push:"
git log origin/main..HEAD --oneline
echo ""
echo "Do you want to push to GitHub? (y/n)"
read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then
echo "Pushing to GitHub..."
git push origin main
if [ $? -eq 0 ]; then
echo ""
echo "✓ Successfully pushed to GitHub!"
echo "Repository: https://github.com/JoeySCT/Sprout-WRO25"
else
echo ""
echo "✗ Push failed. You may need to authenticate."
echo ""
echo "Options:"
echo "1. Use a Personal Access Token:"
echo " - Create token: https://github.com/settings/tokens"
echo " - Push: git push https://<TOKEN>@github.com/JoeySCT/Sprout-WRO25.git main"
echo ""
echo "2. Set up SSH keys:"
echo " - Generate: ssh-keygen -t ed25519 -C 'your@email.com'"
echo " - Add to GitHub: Settings > SSH and GPG keys"
echo ""
echo "3. Use GitHub CLI (gh):"
echo " - Install: sudo apt-get install gh"
echo " - Login: gh auth login"
echo " - Push: git push origin main"
fi
else
echo "Push cancelled."
fi