Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- branches() {
- git branch | sed -e 's/*/ /g' | egrep -v '^[[:space:]]+master$' | awk '{print
- $NF}'
- }
- last_commit() {
- git log -n 1 "${1}" | grep commit | awk '{print $2}'
- }
- branch_is_merged() {
- git log master | grep "commit $(last_commit "${1}")" > /dev/null 2>&1
- }
- unmerged() {
- for branch in $(branches)
- do
- branch_is_merged "${branch}" || echo "${branch}"
- done
- }
Add Comment
Please, Sign In to add comment