Page MenuHomeDevCentral

git-bye
No OneTemporary

#!/bin/sh
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"

File Metadata

Mime Type
text/x-shellscript
Expires
Tue, May 13, 16:58 (5 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2568481
Default Alt Text
git-bye (351 B)

Event Timeline