Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (17 sloc) 533 Bytes
#!/usr/bin/env bash
# git-dwtb: "done with this branch":
# * check back out to master
# * pull "${REMOTE}"/master
# * delete the original branch
# * prune "${REMOTE}"
set -eo pipefail
remote="${REMOTE:-origin}"
branchname=$(git rev-parse --abbrev-ref HEAD)
if [[ "${branchname}" == "master" || "${branchname}" == "HEAD" ]]; then
>&2 echo "Don't run me on master or a symbolic ref!"
exit 1
fi
git checkout master && \
git pull "${remote}" master && \
git branch -D "${branchname}" && \
git remote prune "${remote}"
You can’t perform that action at this time.