From 1388ed247f91e91e36c1ebfe63bf90a489c2028a Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 7 Oct 2019 15:46:51 -0300 Subject: [PATCH] Updating gitsync scrupt. --- gitsync.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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