Allow creation of feature branches even for dirty working trees (using flag -f, --force).
diff --git a/git-flow-feature b/git-flow-feature
index 585b16e..57d5872 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -156,11 +156,14 @@
cmd_start() {
DEFINE_boolean fetch false 'fetch from origin before performing local operation' F
+ DEFINE_boolean force false 'force creation of feature branch (ignores dirty working tree)' f
parse_args "$@"
require_name
# sanity checks
- gitflow_require_clean_working_tree
+ if noflag force; then
+ gitflow_require_clean_working_tree
+ fi
gitflow_require_branch_absent $BRANCH
# update the local repo with remote changes, if asked
@@ -171,7 +174,9 @@
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
# create branch
- git checkout -b $BRANCH $BASE
+ if ! git checkout -b $BRANCH $BASE; then
+ die "Could not create feature branch '$BRANCH'"
+ fi
echo
echo "Summary of actions:"