-
Notifications
You must be signed in to change notification settings - Fork 7
/
push.sh
22 lines (17 loc) · 623 Bytes
/
push.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# Script for pushing git repository to all it's remotes
# If it's called without arguments it pushes current folder
# else it parses $1 - a file containing list of repositories (for example see ../bash/list_example.txt)
git_push_to_all_remotes() {
for origin in $(git remote); do
git push --all "$origin"
done
}
if (( $# == 0 )); then
git_push_to_all_remotes
exit
fi
LISTFILE="$1"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export -f git_push_to_all_remotes
bash "$DIR/../bash/parse_filelist.sh" "$LISTFILE" git_push_to_all_remotes "Pushing repository"