/usr/bin/git-fresh-branch is in git-extras 1.9.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/bin/sh
branch=$1
test -z $branch && echo "branch required." 1>&2 && exit 1
changes=`git status --porcelain`
clean()
{
git symbolic-ref HEAD refs/heads/$branch
rm .git/index
git clean -fdx
}
if [ ! -z "$changes" ]; then
read -p "All untracked changes will be lost. Continue [y/N]? " res
case $res in
[Yy]* ) clean; break;;
* ) exit 0;;
esac
fi
clean
|