4 # File ID: 45c7afa2-434a-11df-8880-90e6ba3022ac
6 # Create new and unconnected branch
7 # usage: git eb <newbranch>
9 logmsg
="Initial empty commit"
10 test -z "$2" || logmsg
="$2"
11 [ -z "$1" ] && { echo "usage: git eb <newbranch>" >&2; exit 1; }
12 [ -d ".git/." ] ||
{ echo "git-eb: has to be executed from the top level of the tree" >&2; exit 1; }
13 [ -e ".git/refs/heads/$1" ] && { echo "git-eb: ref \"$1\" already exists" >&2; exit 1; }
14 git symbolic-ref HEAD refs
/heads
/"$1"
16 git commit
--allow-empty -m "$logmsg`echo; echo; suuid -t commit,git-eb -c "$logmsg"`"