OsmAnd/build-scripts/sync_git_google.sh

26 lines
671 B
Bash
Raw Normal View History

2011-08-15 01:02:33 +02:00
#!/bin/sh
2011-08-15 01:28:42 +02:00
2011-08-15 01:02:33 +02:00
# First time add entries to .git/config (!) and add .netrc file
# [remote "google"]
# url = https://code.google.com/p/osmand/
2011-12-26 20:25:21 +01:00
# fetch = +refs/heads/*:refs/remotes/google/*
git pull google
2011-08-15 01:02:33 +02:00
2011-12-26 20:25:21 +01:00
# 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
2011-12-26 20:27:33 +01:00
git push google :$Branch
2011-12-26 20:25:21 +01:00
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
2011-08-15 01:02:33 +02:00
2011-12-26 20:25:21 +01:00
echo "Synchronization is ok"