From c3c6f306b8437e67e1624dc8d18353c5b27aaaa0 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 22 Apr 2019 10:58:28 -0300 Subject: [PATCH] Updating gitsync.sh --- gitsync.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gitsync.sh b/gitsync.sh index 1ea8a45..670632c 100755 --- a/gitsync.sh +++ b/gitsync.sh @@ -1,14 +1,27 @@ #!/bin/bash # # https://help.github.com/articles/syncing-a-fork/ -# # https://help.github.com/articles/configuring-a-remote-for-a-fork/ +# https://www.opentechguides.com/how-to/article/git/177/git-sync-repos.html +# +# Setup: +# +# git remote add --mirror=fetch secondary https://secondary_repo_url/secondary_repo.git +# git fetch origin +# git push secondary --all # -# git remote add bitbucket https://bitbucket.org/pw3270/pw3270-sharp.git # + +git push + git fetch origin git checkout master git merge origin/master -git push bitbucket +for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') +do + echo "Updating ${repo} ..." + git push ${repo} +done + -- libgit2 0.21.2