diff --git a/gitsync.sh b/gitsync.sh index 848806f..3d89d0a 100755 --- a/gitsync.sh +++ b/gitsync.sh @@ -15,10 +15,18 @@ git push git fetch origin -git checkout master -git merge origin/master +git merge -for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') +REPOS=$(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') + +for repo in ${REPOS} +do + echo "Getting updates from ${repo} ..." + git fetch ${repo} + git merge +done + +for repo in ${REPOS} do echo "Updating ${repo} ..." git push ${repo} -- libgit2 0.21.2