Fix synchronization
This commit is contained in:
parent
bb3d14cd8a
commit
c22c32f9bb
1 changed files with 18 additions and 16 deletions
|
@ -1,23 +1,25 @@
|
|||
#!/bin/sh
|
||||
DIRECTORY=$(cd `dirname $0` && pwd)
|
||||
|
||||
GIT_DIR="$DIRECTORY"/osmand-git
|
||||
GIT_URL=git://github.com/osmandapp/Osmand.git
|
||||
|
||||
|
||||
if [ ! -d "$GIT_DIR" ]; then
|
||||
git clone ${GIT_URL} "${GIT_DIR}"
|
||||
fi
|
||||
cd "$GIT_DIR"
|
||||
git checkout -q .
|
||||
git reset HEAD --hard
|
||||
git checkout -q master
|
||||
|
||||
# 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 push -q --all --force google
|
||||
git pull google
|
||||
|
||||
# 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 origin :$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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue