Last active
August 29, 2015 14:17
-
-
Save kminiatures/5d21bcc2ab3899a0629a to your computer and use it in GitHub Desktop.
merged_branch for bash_completion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash_completion | |
merged_branch () { | |
local branches | |
local input=$2 | |
branches=`git b --no-color --merged | grep -v master` | |
# echo $branches | |
COMPREPLY=($(compgen -W '$branches' -- $input)) | |
} | |
# Delete Remote(pub) and Local Branch. | |
delete_pub_and_local_branch () { | |
local branch=$1 | |
git push pub :$branch; | |
git b -d $branch; | |
} | |
# Add Completion to Command | |
complete -F merged_branch delete_pub_and_local_branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment