-
Notifications
You must be signed in to change notification settings - Fork 464
/
git_track_remote.sh
executable file
·40 lines (33 loc) · 1.14 KB
/
git_track_remote.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
35
36
37
38
39
40
#!/bin/bash
fWelcome() {
clear
echo "======================================================="
echo " _ _ _ _ _ _____ _ _______ _ _______ "
echo "| || || | | | (_____) | | (_______) | (_______)"
echo "| || || | |__ | | _ \ \ _ | | _____ "
echo "| ||_|| | __)| | | | \ \| | | | | ___) "
echo "| |___| | | | |_| |_ _____) ) |_____| |_____| |_____ "
echo " \______|_| |_(_____|______/ \______)_______)_______)"
echo " - - - Signaling the start of next generation telephony"
echo "======================================================="
echo
}
fCleanUpLocal() {
echo "# git gc --prune=now"
git gc --prune=now
}
fCreateMissingBranches() {
while read r; do
l="`echo -n $r | cut -d/ -f 2`"
if [[ -z "`git branch | grep $l`" && "$l" != "HEAD" ]]; then
echo "# git branch --track $l $r"
git branch --track $l $r
fi
done < <(git for-each-ref --format='%(refname:short)' refs/remotes)
}
cd `dirname $0`
fWelcome
fCleanUpLocal
fCreateMissingBranches
echo "Whistle remote branches imported"
exit 0