1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-01 09:10:37 +00:00
qb64/autosync.sh
2019-01-06 16:01:09 +11:00

29 lines
805 B
Bash
Executable file

#!/bin/bash
# This script reproduces any commits on upstream to the given remotes, but only on the given branches.
# It is intended to be run via a cron job or similar.
# The merge is --ff-only, so the target branches must not have anything else adding commits to them.
set -e
cd ~/qb64
# Adding a new branch/remote? git checkout -b $remote-$branch $remote/$branch to create a new local.
BRANCHES='development'
REMOTES='origin fellippe qb64team'
git fetch upstream
for branch in $BRANCHES; do
for remote in $REMOTES; do
git checkout -q $remote-$branch
git merge -q --ff-only upstream/$branch
done
done
for remote in $REMOTES; do
refspecs=
for branch in $BRANCHES; do
refspecs="$refspecs $remote-$branch:$branch"
done
git push -q $remote $refspecs
done