2021-09-20 06:57:20 +00:00
|
|
|
#!/bin/sh -e
|
2021-06-18 15:51:57 +00:00
|
|
|
# set repo as origin and set all branches upstream to a corresponding remote branch, if available
|
|
|
|
git remote remove origin 2>/dev/null
|
|
|
|
git remote add origin $(git-repo "$@")
|
2021-09-20 06:57:20 +00:00
|
|
|
git remote -v && git fetch
|
2021-06-18 15:51:57 +00:00
|
|
|
|
|
|
|
git branch | sed 's/ //g' | sed 's/*//' | while read branch
|
|
|
|
do test $(git branch -a | grep origin/$branch | wc -l) -gt 0 && git branch -u origin/$branch $branch
|
|
|
|
done
|