Created
August 18, 2011 14:17
-
-
Save bmeurer/1154143 to your computer and use it in GitHub Desktop.
Sync the ~/git/ocaml.git repository with the master Subversion repository at Inria and upload the changes to GitHub at bmeurer/ocaml.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ~/bin/ocaml-git-sync.sh: Sync the ~/git/ocaml.git repository with the master | |
# Subversion repository at Inria and upload the changes | |
# to GitHub at bmeurer/ocaml. | |
# Copyright (c) 2011 Benedikt Meurer <[email protected]> | |
# | |
# Repository location | |
GIT_DIR="$HOME/git/ocaml.git" | |
export GIT_DIR | |
# Update with latest changes from Subversion | |
git --bare svn fetch --all --no-checkout --quiet || exit $? | |
# Update local tracking branches | |
for branch in `git --bare branch -r | grep -v github`; do | |
git --bare branch -f -t "$branch" "remotes/$branch" > /dev/null | |
done | |
# Minify! | |
git --bare repack -A -d -q || exit $? | |
git --bare gc -q || exit $? | |
# Push to GitHub | |
git --bare push -q github 'refs/heads/*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment