-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.sh
More file actions
17 lines (12 loc) · 650 Bytes
/
sync.sh
File metadata and controls
17 lines (12 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# This script synchronizes the main branch from the origin repository to the client repository.
# It performs a force push which will overwrite any divergent changes in the client repository.
# Use with caution as this is a destructive operation.
echo "Fetching latest changes..."
git fetch origin
git fetch client
echo "Resetting client branch to match origin (force overwrite)..."
git reset --hard origin/main # Ensures local branch exactly matches origin
echo "Force pushing to client repo..."
git push --force client main # Overwrites the client repo
echo "Sync completed! The client repository is now up-to-date with origin."