Page MenuHomeDevCentral

git-respawn
No OneTemporary

git-respawn

#!/usr/bin/env bash
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" = "master" ]; then
echo "You're already on the master branch."
exit 1
fi
# Updates master branch if there isn't any staged change and working tree is clean
git checkout master
git diff-index --quiet --cached HEAD -- && git diff-files --quiet && git pull
git branch -D "$BRANCH"
# Fetch new branch
if [ ${BRANCH:0:10} = "arcpatch-D" ]; then
arc patch ${BRANCH:9}
fi

File Metadata

Mime Type
text/x-shellscript
Expires
Fri, Nov 6, 11:07 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4144570
Default Alt Text
git-respawn (453 B)

Event Timeline