Commit 404ddc9a authored by Hugo Buddelmeijer's avatar Hugo Buddelmeijer
Browse files

Only echo when something changes.

parent 00740df9
......@@ -3,20 +3,16 @@
# Echo commands and exit on first error
set -e
echo "Going to synchronize"
remotes=$(git remote)
echo "Synchronizing: ${remotes}" | tr '\n' ' '
git checkout master
git checkout master -q
# Fetch changes from remotes.
for remote in $remotes; do
git fetch "${remote}"
theyahead=$(git rev-list --count "master..${remote}/master")
echo "Remote ${remote} is $theyahead ahead!"
if [ "${theyahead}" -gt 0 ]; then
echo "Remote ${remote} is $theyahead ahead!"
git merge -m "Synchronize ${remote} into master" "${remote}/master"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment