2011-12-26 20:31:24 +01:00
|
|
|
#!/bin/bash
|
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:31:24 +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"
|