Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- BRANCHES=("origin/HEAD" "origin/master" "master")
- checkBranch() {
- for BR in ${BRANCHES[@]}
- do
- if [[ ${1} == ${BR} ]]
- then
- return 1;
- fi
- done
- return 0;
- }
- for BRANCH in $(git for-each-ref --format='%(refname:lstrip=2)' --merged)
- do
- if checkBranch ${BRANCH}
- then
- if [[ ${BRANCH:0:6} == 'origin' ]]
- then
- echo 'ORIGIN' ${BRANCH}
- else
- echo 'NOT ORIGIN' ${BRANCH}
- fi
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement