-
Notifications
You must be signed in to change notification settings - Fork 10
/
git-list-branches
executable file
·35 lines (26 loc) · 1.89 KB
/
git-list-branches
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
#!/bin/bash
echo ""
echo -e "###> \033[31mMANDATORY BRANCHES\033[0m"
echo ""
echo -e " \033[32mmaster\033[0m and \033[32mdevelopment\033[0m branches are excluded from the list"
count=$(git branch -r --no-merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1 | wc -l)
echo ""
echo -e "###> \033[31m${count//[[:space:]]/} UNMERGED REMOTE BRANCHES\033[0m"
echo ""
git branch -r --no-merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1
count=$(git branch --no-merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1 | wc -l)
echo ""
echo -e "###> \033[31m${count//[[:space:]]/} UNMERGED LOCAL BRANCHES\033[0m"
echo ""
git branch --no-merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1
count=$(git branch -r --merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1 | wc -l)
echo ""
echo -e "###> \033[31m${count//[[:space:]]/} MERGED REMOTE BRANCHES\033[0m"
echo ""
git branch -r --merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1
count=$(git branch --merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1 | wc -l)
echo ""
echo -e "###> \033[31m${count//[[:space:]]/} MERGED LOCAL BRANCHES\033[0m"
echo ""
git branch --merged | grep -v master | grep -v development | xargs -L1 git --no-pager log --pretty=tformat:'%Cgreen%d%Creset - %h by %an (%Cblue%ar%Creset)' -1
echo ""