12345678910111213141516171819202122232425262728 |
- #!/bin/sh
- set -e
- if ! GITDIR=$(git rev-parse --git-dir) ; then
- echo "Not in a git repository" >&2
- exit 0
- fi
- TREE=$(dirname $GITDIR)
- cd $TREE
- if [ -d .git/annex ] ; then
- echo "In an annex repository"
- git annex sync
- exit
- fi
- [ -e pre-sync ] && sh pre-sync
- git stash push -u -m "SYNC SAVE"
- git pull --all
- [ -e mid-sync ] && sh mid-sync
- git push --all origin
- [ -e post-sync ] && sh post-sync
- if git stash list | grep "SYNC SAVE" >/dev/null ; then
- git stash pop -q
- fi
|