From bc1f81ea1074f019666504e976c7a720f4f9b4f4 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 27 Feb 2019 08:52:18 -0300 Subject: [PATCH] Adding gitsync scripts. --- gitsync.sh | 28 ++++++++++++++++++++++++++++ pushtag.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 0 deletions(-) create mode 100755 gitsync.sh create mode 100755 pushtag.sh diff --git a/gitsync.sh b/gitsync.sh new file mode 100755 index 0000000..cacb378 --- /dev/null +++ b/gitsync.sh @@ -0,0 +1,28 @@ +#!/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 github https://github.com/PerryWerneck/lib3270.git +# git fetch origin +# git push github --all +# +# + +git push + +git fetch origin +git checkout master +git merge origin/master + +for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') +do + echo "Updating ${repo} ..." + git push ${repo} +done + diff --git a/pushtag.sh b/pushtag.sh new file mode 100755 index 0000000..11eaf15 --- /dev/null +++ b/pushtag.sh @@ -0,0 +1,34 @@ +#!/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 github https://github.com/PerryWerneck/lib3270.git +# +# + +if [ -z ${1} ]; then + echo "Inform target tag" + exit -1 +fi + +git push + +git fetch origin +git checkout master +git merge origin/master + +git tag -f ${1} +git push -f --tags + +for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') +do + echo "Updating ${repo} ..." + git push ${repo} -f --tags +done + -- libgit2 0.21.2