3 # Syncs with remote hosts in the git (sub)directories.
5 # Allows fetching (no merge) and pushing at the moment.
8 # Select the method, fetch and push is possible.
9 if [ x$1 = x -o x$1 = xfetch -o x$1 = xfe ]; then
11 elif [ $1 = push -o $1 = pu ]; then
14 echo "Usage: sync.sh [fetch | fe | push | pu ]"
16 echo "fetch: Fetch from all remotes."
17 echo "push: Push to all remotes."
21 # Fetch from/Push to each remote of each git subdirectory.
22 for project in `find . -name .git -type d`; do
23 if [ -d "$project" ]; then
27 # Fetch from/Push to all remotes.
28 for remote in `git remote`; do
29 echo "$project: ${method}ing $remote ..."