Commit c3c6f306b8437e67e1624dc8d18353c5b27aaaa0
1 parent
62075540
Exists in
master
Updating gitsync.sh
Showing
1 changed file
with
16 additions
and
3 deletions
Show diff stats
gitsync.sh
1 | 1 | #!/bin/bash |
2 | 2 | # |
3 | 3 | # https://help.github.com/articles/syncing-a-fork/ |
4 | -# | |
5 | 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 | |
6 | 12 | # |
7 | -# git remote add bitbucket https://bitbucket.org/pw3270/pw3270-sharp.git | |
8 | 13 | # |
14 | + | |
15 | +git push | |
16 | + | |
9 | 17 | git fetch origin |
10 | 18 | git checkout master |
11 | 19 | git merge origin/master |
12 | 20 | |
13 | -git push bitbucket | |
21 | +for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') | |
22 | +do | |
23 | + echo "Updating ${repo} ..." | |
24 | + git push ${repo} | |
25 | +done | |
26 | + | |
14 | 27 | ... | ... |