mirror of
https://github.com/tj/git-extras.git
synced 2026-09-13 00:46:26 -04:00
Use `git create-branch` instead of `git checkout -b` in: git-bug git-chore git-feature git-refactor Since `git-finish` uses `git-delete-branch` (which expects the branch to have been pushed to origin) we should use `git-create-branch` to create it.
15 lines
423 B
Bash
Executable file
15 lines
423 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
if test "$1" = "finish"; then
|
|
test -z $2 && echo "bug <name> required." 1>&2 && exit 1
|
|
branch=bug/$2
|
|
git merge --no-ff $branch && git delete-branch $branch
|
|
else
|
|
test -z $1 && echo "bug <name> required." 1>&2 && exit 1
|
|
if test -n "$2"; then
|
|
echo "too many arguments; if not finishing a bug, only <name> of new bug is expected" && exit 1
|
|
fi
|
|
branch=bug/$1
|
|
git create-branch $branch
|
|
fi
|