OsmAnd/build-scripts/sync_git_google.sh

27 lines
699 B
Bash
Raw Normal View History

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/*
2011-12-26 20:39:25 +01:00
git fetch origin -p
git fetch google --all
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:39:25 +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"