Skip to content

Instantly share code, notes, and snippets.

@tmacam
Created March 5, 2013 13:24
Show Gist options
  • Save tmacam/5090266 to your computer and use it in GitHub Desktop.
Save tmacam/5090266 to your computer and use it in GitHub Desktop.
"park" an old branch
#!/bin/sh
set -e
BRANCH=${1:?"Usage: $0 [BRANCH]"}
if ! ( git branch | grep -q ${BRANCH} ); then
echo "ERROR: Uknown branch '${BRANCH}'" > /dev/stderr
exit 1
fi
set -x
git checkout ${BRANCH}
git checkout -b "zDONE_${BRANCH}"
git branch -d ${BRANCH}
git push origin :${BRANCH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment