From 5846c6d81fe821017396caf101bf9f3c0ac2e24a Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 18 Feb 2009 19:51:07 +0100 Subject: [PATCH] Add sync.sh which fetches all remote branches. All remote branches of all git repositories in or under this directory are fetched. --- sync.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 sync.sh diff --git a/sync.sh b/sync.sh new file mode 100755 index 0000000..31084e5 --- /dev/null +++ b/sync.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Fetches the current master from all remotes. Used to sync with all remote +# hosts. No merging is done. + + +# Fetch from each remote of each git subdirectory. +for project in `find . -name .git -type d`; do + if [ -d "$project" ]; then + pwd=`pwd` + cd "$project" + + # Fetch from all remotes. + for remote in `git remote`; do + echo "$project: fetching $remote ..." + git fetch "$remote" + done + + cd "$pwd" + fi +done -- 2.44.1