OsmAnd/build-scripts/sync_git_google.sh
Victor Shcherb fe3b41dbbf Prune
2011-12-26 20:39:25 +01:00

26 lines
699 B
Bash
Executable file

#!/bin/bash
# First time add entries to .git/config (!) and add .netrc file
# [remote "google"]
# url = https://code.google.com/p/osmand/
# fetch = +refs/heads/*:refs/remotes/google/*
git fetch origin -p
git fetch google --all
# Delete old branches
for f in `git for-each-ref --format='%(refname)' | grep 'refs/remotes/google'`
do
Branch=`echo $f | cut -d '/' -f 4`
if [[ -z `git show-ref refs/remotes/origin/$Branch` ]]; then
git push google :$Branch
fi
done
# Delete old branches
for f in `git for-each-ref --format='%(refname)' | grep 'refs/remotes/origin'`
do
Branch=`echo $f | cut -d '/' -f 4`
git push google origin/$Branch:refs/heads/$Branch
done
echo "Synchronization is ok"