-
Notifications
You must be signed in to change notification settings - Fork 3
/
pushall.sh
executable file
·34 lines (34 loc) · 996 Bytes
/
pushall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
for fn in * .; do
test -d "$fn" &&
echo "Directory: $fn" &&
test -e "$fn"/.git || continue
(
cd "$PWD"
cd "$fn"
git config core.autocrlf true
git add -u
git-ad 'bulk push from tearless master project' | grep 'HEAD detached' && {
echo fucking head detached "$PWD/$fn"
git branch | grep '^..temp$' && {
git branch -d temp || {
echo "ABORT! temp branch is currently live, fix it"
exit
}
}
git fetch &&
git checkout -b temp &&
git checkout -B master temp &&
git merge origin master -m 'pushall' &&
git push &&
git branch -d temp
}
git fetch
git merge origin master -m 'pushall'
git push
# git status
# git add u
# git commit -m "$@"
# git push origin master
)
done