-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-phase-merge.sh
More file actions
executable file
·52 lines (42 loc) · 1.44 KB
/
git-phase-merge.sh
File metadata and controls
executable file
·52 lines (42 loc) · 1.44 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
#!/bin/bash
# Git Phase Merge Script
# Usage: ./scripts/git-phase-merge.sh <phase_number>
set -e
# Check arguments
if [ $# -lt 1 ]; then
echo "Usage: $0 <phase_number>"
echo "Example: $0 1"
exit 1
fi
PHASE_NUMBER=$1
# -- Determine Branch Name (8-Phase Structure)
case "$PHASE_NUMBER" in
1) BRANCH_NAME="phase-setup-automation" ;;
2) BRANCH_NAME="phase-identity-auth" ;;
3) BRANCH_NAME="phase-frontend-core" ;;
4) BRANCH_NAME="phase-wallet-engine" ;;
5) BRANCH_NAME="phase-dashboard-htmx" ;;
6) BRANCH_NAME="phase-async-reporting" ;;
7) BRANCH_NAME="phase-staff-analytics" ;;
8) BRANCH_NAME="phase-qa-deployment" ;;
*)
echo "Error: Invalid phase number. Must be between 1 and 8."
exit 1
;;
esac
# Checkout master and pull latest
echo "Switching to master branch..."
git checkout master
git pull origin master
# Merge phase branch
echo "Merging $BRANCH_NAME into master..."
git merge "$BRANCH_NAME" -m "Merge Phase $PHASE_NUMBER: Completed and verified"
# Push master to remote
echo "Pushing master to remote..."
git push origin master
# Delete local and remote phase branch (Remote-First Workflow cleanup)
echo "Cleaning up phase branch..."
git branch -d "$BRANCH_NAME"
git push origin --delete "$BRANCH_NAME" 2>/dev/null || echo " (Remote branch already deleted)"
echo "✓ Successfully merged Phase $PHASE_NUMBER ($BRANCH_NAME) into master"
echo "✓ Remote-First Workflow cleanup complete"