forked from keycloak/keycloak-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.sh
More file actions
executable file
·29 lines (20 loc) · 733 Bytes
/
sync.sh
File metadata and controls
executable file
·29 lines (20 loc) · 733 Bytes
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
#!/bin/bash
BRANCHES="upstream/master prod/3.4.x prod/4.8.x"
echo "-----------------------------------------------------------------"
echo "Fetching remotes"
echo ""
git fetch upstream
git fetch gitlab
git fetch prod
echo "-----------------------------------------------------------------"
for i in $BRANCHES; do
TARGET_BRANCH=`echo $i | cut -d '/' -f 2`
echo "Syncing $i to gitlab/$TARGET_BRANCH"
echo ""
git branch | grep " tmp-$TARGET_BRANCH$" &>/dev/null && git branch -D tmp-$TARGET_BRANCH
git checkout $i -b tmp-$TARGET_BRANCH
git push gitlab tmp-$TARGET_BRANCH:$TARGET_BRANCH
git checkout master
git branch -D tmp-$TARGET_BRANCH
echo "-----------------------------------------------------------------"
done