-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync-github.sh
More file actions
executable file
·36 lines (29 loc) · 1.02 KB
/
Copy pathsync-github.sh
File metadata and controls
executable file
·36 lines (29 loc) · 1.02 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
#!/bin/bash
echo "🔄 Starting GitHub sync..."
# Set up GitHub authentication with token
echo "Setting up authentication..."
git remote set-url origin https://${GITHUB_TOKEN}@github.com/thatappguy71/EvolvAssistant.git
# Configure git user (if not already configured)
git config user.email "evolv@replit.user" 2>/dev/null
git config user.name "Evolv Replit" 2>/dev/null
# Pull latest changes from GitHub
echo "Pulling latest changes from GitHub..."
git pull origin main --rebase 2>/dev/null || echo "No remote changes to pull"
# Stage all changes
echo "Staging changes..."
git add -A
# Create commit with timestamp
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
git commit -m "Sync: $TIMESTAMP" 2>/dev/null || {
echo "✅ No changes to commit - already up to date!"
exit 0
}
# Push to GitHub
echo "Pushing to GitHub..."
if git push origin main 2>&1; then
echo "✅ Successfully synced to GitHub!"
echo "Timestamp: $TIMESTAMP"
else
echo "❌ Failed to push. Please check your GitHub token and repository permissions."
exit 1
fi