Commit b1013a5181b9812ec54755f3f6480f6fe2f332e2
1 parent
d61f4ae9
Exists in
master
and in
1 other branch
Adding sync script.
Showing
1 changed file
with
25 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,25 @@ | @@ -0,0 +1,25 @@ | ||
| 1 | +#!/bin/bash | ||
| 2 | +# | ||
| 3 | +# https://help.github.com/articles/syncing-a-fork/ | ||
| 4 | +# https://help.github.com/articles/configuring-a-remote-for-a-fork/ | ||
| 5 | +# https://www.opentechguides.com/how-to/article/git/177/git-sync-repos.html | ||
| 6 | +# | ||
| 7 | +# Setup: | ||
| 8 | +# | ||
| 9 | +# git remote add --mirror=fetch secondary https://secondary_repo_url/secondary_repo.git | ||
| 10 | +# git fetch origin | ||
| 11 | +# git push secondary --all | ||
| 12 | +# | ||
| 13 | +# | ||
| 14 | + | ||
| 15 | +git fetch origin | ||
| 16 | +git checkout master | ||
| 17 | +git merge origin/master | ||
| 18 | + | ||
| 19 | +for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') | ||
| 20 | +do | ||
| 21 | + echo "Updating ${repo} ..." | ||
| 22 | + git push ${repo} | ||
| 23 | +done | ||
| 24 | + | ||
| 25 | + |