Commit bd4a1f12 authored by Vincent Driessen's avatar Vincent Driessen

Merge branch 'review' into develop

parents f7812423 c7bbfcf4
GIT_EXEC_PATH=/usr/libexec/git-core
all:
@echo "There is only one target here: install"
@echo "This message is deliberately inserted here to prevent accidental installation."
@echo ""
@echo "Use 'make install' explicitly to install git-flow."
install:
install -m 0755 -t $(GIT_EXEC_PATH) git-flow
install -m 0644 -t $(GIT_EXEC_PATH) \
git-flow-feature \
git-flow-hotfix \
git-flow-release \
git-flow-support \
git-flow-version
......@@ -3,9 +3,6 @@ TODO-list
General configuration
---------------------
- Support configurable naming for fixed branch names 'master' and 'develop'
- Support configurable naming conventions (i.e. name prefixes) for supporting
branches, instead of fixed 'release-\*' and 'hotfix-\*'
Release branch support
----------------------
......
......@@ -2,79 +2,193 @@
#
# gitflow -- A collection of Git wrapper scripts to provide high-level
# repository operations for Vincent Driessen's branching model:
#
#
# Original blog post presenting this model is found at:
# http://nvie.com/archives/323
#
#
# Feel free to contribute to this project at:
# http://github.com/nvie/gitflow
#
# Copyright (c) 2010 by Vincent Driessen
# Copyright (c) 2010 by Benedikt Böhm
#
# Get the git dir
GIT_DIR=$(git rev-parse --git-dir)
# enable debug mode
if [ "$DEBUG" = "yes" ]; then
set -x
fi
# Get all available branches
LOCAL_BRANCHES=$(git branch | sed 's/^[* ] //')
REMOTE_BRANCHES=$(git branch -r | sed 's/^[* ] //')
ALL_BRANCHES="$LOCAL_BRANCHES\n$REMOTE_BRANCHES"
export GITFLOW_DIR=$(dirname "$0")
export MASTER_BRANCH=$(git config --get gitflow.branch.master || echo master)
export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop || echo develop)
export ORIGIN=$(git config --get gitflow.origin || echo origin)
export README=$(git config --get gitflow.readme || echo README)
warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; }
has() {
local item=$1; shift
echo " $@ " | grep -q " $item "
}
usage() {
. "$GITFLOW_DIR/git-flow-version"
echo "gitflow, version $GITFLOW_VERSION"
echo
echo "usage: git flow <cmd> <type> <args>"
echo " git flow init [<url>]"
echo
echo "<type> can be any of: feature, release, hotfix, support"
echo
echo "Try 'git flow help <type>' for details."
}
main() {
if [ $# -lt 1 ]; then
usage
exit 1
fi
# sanity checks
ACTION="$1"; shift
if [ "$ACTION" = "init" ]; then
gitflow_init "$@"
exit 0
fi
BTYPE="$1"; shift
if [ ! -e "$GITFLOW_DIR/git-flow-$BTYPE" ]; then
usage
exit 1
fi
if ! git rev-parse --git-dir &>/dev/null; then
die "Not a git repository"
fi
# get all available branches
LOCAL_BRANCHES=$(git branch | sed 's/^[* ] //')
REMOTE_BRANCHES=$(git branch -r | sed 's/^[* ] //')
ALL_BRANCHES="$LOCAL_BRANCHES $REMOTE_BRANCHES"
# run command
. "$GITFLOW_DIR/git-flow-$BTYPE"
if ! declare -f cmd_$ACTION >/dev/null; then
usage
exit 1
fi
# run command
cmd_$ACTION "$@"
}
gitflow_init() {
echo
echo "Summary of actions:"
if ! git rev-parse --git-dir &>/dev/null; then
git init --quiet
echo "- A new git repository at $PWD was created"
fi
if ! git rev-parse --quiet --verify HEAD >/dev/null; then
touch $README
git add $README
git commit --quiet -m "initial commit"
if [ "$MASTER_BRANCH" != "master" ]; then
git branch -m master $MASTER_BRANCH
fi
echo "- An initial commit was created at branch '$MASTER_BRANCH'"
fi
if ! git rev-parse --verify $MASTER_BRANCH &>/dev/null; then
die "Cannot find your master branch. Try: git branch -m <mymaster> $MASTER_BRANCH"
fi
gitflow_check_clean_working_tree
if git remote | grep -q $ORIGIN; then
git fetch -q $ORIGIN
gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
fi
if git rev-parse --verify $DEVELOP_BRANCH &>/dev/null; then
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
else
git checkout -q -b $DEVELOP_BRANCH $MASTER_BRANCH
echo "- A new branch '$DEVELOP_BRANCH' was created"
echo "- You are now on branch '$DEVELOP_BRANCH'"
fi
if ! git remote | grep -q $ORIGIN; then
if [ "$1" = "" ]; then
echo "- No remote location was added. Try: git remote add $ORIGIN <url>"
else
git remote add $ORIGIN $1
echo "- A new remote location '$1' was added"
fi
fi
echo
if git remote | grep -q $ORIGIN; then
git push $ORIGIN $MASTER_BRANCH $DEVELOP_BRANCH
fi
}
gitflow_check_clean_working_tree() {
if [ "$(git status 2>/dev/null | tail -n1)" != "nothing to commit (working directory clean)" ]; then
die "Working directory is dirty. Only use gitflow in clean working directories for your own safety."
if ! git diff --no-ext-diff --ignore-submodules --quiet --exit-code; then
die "Working tree contains unstaged changes. Aborting ..."
fi
if ! git diff-index --cached --quiet --ignore-submodules HEAD --; then
die "Index contains uncommited changes. Aborting ..."
fi
}
gitflow_require_local_branch() {
echo "$LOCAL_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -ne 0 ]; then
if ! has $1 $LOCAL_BRANCHES; then
die "Local branch '$1' does not exist and is required."
fi
}
gitflow_require_remote_branch() {
echo "$REMOTE_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -ne 0 ]; then
if ! has $1 $REMOTE_BRANCHES; then
die "Remote branch '$1' does not exist and is required."
fi
}
gitflow_require_branch() {
echo "$ALL_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -ne 0 ]; then
if ! has $1 $ALL_BRANCHES; then
die "Branch '$1' does not exist and is required."
fi
}
gitflow_require_branch_absent() {
echo "$ALL_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -eq 0 ]; then
if has $1 $ALL_BRANCHES; then
die "Branch '$1' already exists. Pick another name."
fi
}
#
# gitflow_test_branches_equal()
#
#
# Tests whether branches and their "origin" counterparts have diverged and need
# merging first. It returns error codes to provide more detail, like so:
#
# 0 Branch heads point to the same commit
# 1 First given branch needs fast-forwarding
# 2 Second given branch needs fast-forwarding
# 3 Branch needs a real merge
#
# 0 Branch heads point to the same commit
# 1 First given branch needs fast-forwarding
# 2 Second given branch needs fast-forwarding
# 3 Branch needs a real merge
#
gitflow_test_branches_equal() {
commit1=$(git rev-parse "$1")
commit2=$(git rev-parse "$2")
if [ "$commit1" != "$commit2" ]; then
base=$(git merge-base "$commit1" "$commit2")
short_base=$(git rev-parse --short "$base")
if [ "$commit1" = "$base" ]; then
return 1
elif [ "$commit2" = "$base" ]; then
......@@ -94,7 +208,6 @@ gitflow_require_branches_equal() {
status=$?
if [ $status -gt 0 ]; then
warn "Branches '$1' and '$2' have diverged."
if [ $status -eq 1 ]; then
die "And branch '$1' may be fast-forwarded."
elif [ $status -eq 2 ]; then
......@@ -106,3 +219,4 @@ gitflow_require_branches_equal() {
fi
}
main "$@"
#!/bin/sh
#
# gitflow -- A collection of Git wrapper scripts to provide high-level
# repository operations for Vincent Driessen's branching model:
#
#
# Original blog post presenting this model is found at:
# http://nvie.com/archives/323
#
#
# Feel free to contribute to this project at:
# http://github.com/nvie/gitflow
#
# Copyright (c) 2010 by Vincent Driessen
# Copyright (c) 2010 by Benedikt Böhm
#
usage() {
echo "usage: gitflow start feature [<options>] <name> [<base>]"
echo " gitflow finish feature [<options>] <name>"
echo "usage: git flow start feature <name> [<base>]"
echo " git flow finish feature <name> [<base>]"
echo " git flow publish feature <name>"
echo " git flow track feature <name>"
# TODO
#echo ""
#echo "options:"
......@@ -31,69 +33,124 @@ usage() {
}
parse_args() {
FEATURE="$1"
if [ $# -eq 2 ]; then
BASE="$2"
else
BASE="develop"
fi
if [ "$FEATURE" = "" ]; then
echo "Missing argument <release>"
NAME="$1"
BASE="${2:-$DEVELOP_BRANCH}"
if [ "$NAME" = "" ]; then
echo "Missing argument <name>."
usage
exit 1
fi
PREFIX=$(git config --get gitflow.prefix.feature || echo feature/)
BRANCH=$PREFIX$NAME
}
cmd_help() {
usage
exit 0
}
start() {
cmd_start() {
parse_args "$@"
# Checks
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch_absent "$FEATURE"
if [ "$BASE" = "develop" ]; then
gitflow_require_branches_equal 'develop' 'origin/develop'
gitflow_require_branch_absent $BRANCH
if [ "$BASE" = "$DEVELOP_BRANCH" ]; then
git fetch -q $ORIGIN $DEVELOP_BRANCH
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
fi
# All checks passed, ready to roll
git checkout -b "$FEATURE" "$BASE"
# create branch
git checkout -b $BRANCH $BASE
echo ""
echo
echo "Summary of actions:"
echo "- A new branch '$FEATURE' was created, based on '$BASE'"
echo "- You are now on branch '$FEATURE'"
echo "- A new branch '$BRANCH' was created, based on '$BASE'"
echo "- You are now on branch '$BRANCH'"
echo ""
echo "Now, start committing on your feature. When done, use:"
echo ""
echo " gitflow finish feature '$FEATURE'"
echo " git flow finish feature $NAME"
echo
}
finish() {
cmd_finish() {
parse_args "$@"
# Checks
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch "$FEATURE"
gitflow_require_branches_equal 'develop' 'origin/develop'
# All checks passed, ready to roll
git checkout develop
gitflow_require_branch $BRANCH
git fetch -q $ORIGIN
if has $ORIGIN/$BRANCH $REMOTE_BRANCHES; then
gitflow_require_branches_equal $BRANCH $ORIGIN/$BRANCH
fi
if [ "$BASE" = "$DEVELOP_BRANCH" ]; then
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
fi
# In case there has been only a single commit in the feature branch, don't
# use --no-ff, since it has no extra advantages
FF_FLAG="--no-ff"
if [ "$(git rev-list develop.."$FEATURE" | wc -l)" -eq 1 ]; then
FF_FLAG="--ff"
# merge into BASE
git checkout $BASE
if [ "$(git rev-list -n2 $BASE..$BRANCH | wc -l)" = "1" ]; then
git merge --ff $BRANCH
else
git merge --no-ff $BRANCH
fi
git merge "$FF_FLAG" "$FEATURE"
# delete branch
# TODO: How do we handle merge conflicts here??
git branch -d "$FEATURE"
git push $ORIGIN :refs/heads/$BRANCH
git branch -d $BRANCH
echo ""
echo
echo "Summary of actions:"
echo "- The feature branch '$FEATURE' was merged into 'develop'"
echo "- The feature branch '$BRANCH' was merged into '$BASE'"
#echo "- Merge conflicts were resolved" # TODO: Add this line when it's supported
echo "- Feature branch '$FEATURE' has been removed"
echo "- You are now on branch 'develop'"
echo ""
echo "- Feature branch '$BRANCH' has been removed"
echo "- You are now on branch '$BASE'"
echo
}
cmd_publish() {
parse_args "$@"
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch $BRANCH
git fetch -q $ORIGIN
gitflow_require_branch_absent $ORIGIN/$BRANCH
# create remote branch
git push $ORIGIN $BRANCH:refs/heads/$BRANCH
git fetch -q $ORIGIN
# configure remote tracking
git config branch.$BRANCH.remote $ORIGIN
git config branch.$BRANCH.merge refs/heads/$BRANCH
git checkout $BRANCH
echo
echo "Summary of actions:"
echo "- A new remote branch '$BRANCH' was created"
echo "- The local branch '$BRANCH' was configured to track the remote branch"
echo "- You are now on branch '$BRANCH'"
echo
}
cmd_track() {
parse_args "$@"
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branch_absent $BRANCH
git fetch -q $ORIGIN
gitflow_require_branch $ORIGIN/$BRANCH
# create tracking branch
git checkout -b $BRANCH $ORIGIN/$BRANCH
echo
echo "Summary of actions:"
echo "- A new remote tracking branch '$BRANCH' was created"
echo "- You are now on branch '$BRANCH'"
echo
}
#!/bin/sh
#
# gitflow -- A collection of Git wrapper scripts to provide high-level
# repository operations for Vincent Driessen's branching model:
#
#
# Original blog post presenting this model is found at:
# http://nvie.com/archives/323
#
#
# Feel free to contribute to this project at:
# http://github.com/nvie/gitflow
#
# Copyright (c) 2010 by Vincent Driessen
# Copyright (c) 2010 by Benedikt Böhm
#
usage() {
echo "usage: gitflow start hotfix <release>"
echo " gitflow finish hotfix <release>"
echo "usage: git flow start hotfix <version> [<base>]"
echo " git flow finish hotfix <version> [<base>]"
# TODO
#echo ""
#echo "options:"
......@@ -28,68 +28,84 @@ usage() {
}
parse_args() {
RELEASE="$1"
if [ "$RELEASE" = "" ]; then
echo "Missing argument <release>"
VERSION="$1"
BASE="${2:-$MASTER_BRANCH}"
if [ "$VERSION" = "" ]; then
echo "Missing argument <version>."
usage
exit 1
fi
HOTFIX_BRANCH="hotfix-$RELEASE"
PREFIX=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
BRANCH=$PREFIX$VERSION
}
cmd_help() {
usage
exit 0
}
start() {
cmd_start() {
parse_args "$@"
# Checks
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branches_equal 'master' 'origin/master'
gitflow_require_branch_absent "$HOTFIX_BRANCH"
git fetch -q $ORIGIN
gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branch_absent $BRANCH
# All checks passed, ready to roll
git checkout -b "$HOTFIX_BRANCH" master
# create branch
git checkout -b $BRANCH $BASE
echo ""
echo
echo "Summary of actions:"
echo "- A new branch '$HOTFIX_BRANCH' was created, based on 'master'"
echo "- You are now on branch '$HOTFIX_BRANCH'"
echo ""
echo "- A new branch '$BRANCH' was created, based on '$BASE'"
echo "- You are now on branch '$BRANCH'"
echo
echo "Follow-up actions:"
echo "- Bump the version number now!"
echo "- Start committing your hot fixes"
echo "- When done, run:"
echo ""
echo " gitflow finish hotfix '$HOTFIX_BRANCH'"
echo
echo " git flow finish hotfix '$HOTFIX_BRANCH'"
echo
}
finish() {
cmd_finish() {
parse_args "$@"
# Checks
# sanity checks
gitflow_check_clean_working_tree
git fetch -q $ORIGIN $MASTER_BRANCH
git fetch -q $ORIGIN $DEVELOP_BRANCH
gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
git fetch origin develop # TODO: Make a flag to skip these fetches
git fetch origin master # TODO: Make a flag to skip these fetches
gitflow_require_branches_equal 'master' 'origin/master'
gitflow_require_branches_equal 'develop' 'origin/develop'
# merge into BASE
git checkout $BASE
git merge --no-ff $BRANCH
git tag v$VERSION
# All checks passed, ready to roll
git checkout master
git merge --no-ff "$HOTFIX_BRANCH"
git tag "$RELEASE"
git checkout develop
git merge --no-ff "$HOTFIX_BRANCH"
git branch -d "$HOTFIX_BRANCH"
# merge into develop if we fixed a master issue
# TODO: merge into support branch
if [ "$BASE" = "$MASTER_BRANCH" ]; then
git checkout $DEVELOP_BRANCH
git merge --no-ff $BRANCH
fi
# delete branch
git branch -d $BRANCH
# TODO: Implement an optional push to master
# git push origin develop; git push origin master; git push --tags origin
echo ""
echo
echo "Summary of actions:"
echo "- Latest objects have been fetched from 'origin'"
echo "- Hotfix branch has been merged into 'master'"
echo "- The hotfix was tagged '$RELEASE'"
echo "- Hotfix branch has been back-merged into 'develop'"
echo "- Hotfix branch '$HOTFIX_BRANCH' has been deleted"
echo ""
echo "- Latest objects have been fetched from '$ORIGIN'"
echo "- Hotfix branch has been merged into '$BASE'"
echo "- The hotfix was tagged 'v$VERSION'"
if [ "$BASE" = "$MASTER_BRANCH" ]; then
echo "- Hotfix branch has been back-merged into '$DEVELOP_BRANCH'"
fi
echo "- Hotfix branch '$BRANCH' has been deleted"
echo
}
#!/bin/sh
#
# gitflow -- A collection of Git wrapper scripts to provide high-level
# repository operations for Vincent Driessen's branching model:
#
#
# Original blog post presenting this model is found at:
# http://nvie.com/archives/323
#
#
# Feel free to contribute to this project at:
# http://github.com/nvie/gitflow
#
# Copyright (c) 2010 by Vincent Driessen
# Copyright (c) 2010 by Benedikt Böhm
#
usage() {
echo "usage: gitflow start release <release>"
echo " gitflow finish release <release>"
echo "usage: git flow start release <version>"
echo " git flow finish release <version>"
# TODO
#echo ""
#echo "options:"
......@@ -29,68 +29,77 @@ usage() {
}
parse_args() {
RELEASE="$1"
if [ "$RELEASE" = "" ]; then
echo "Missing argument <release>"
VERSION="$1"
if [ "$VERSION" = "" ]; then
echo "Missing argument <version>."
usage
exit 1
fi
RELEASE_BRANCH="release-$RELEASE"
PREFIX=$(git config --get gitflow.prefix.release || echo release/)
BRANCH=$PREFIX$VERSION
}
cmd_help() {
usage
exit 0
}
start() {
cmd_start() {
parse_args "$@"
# Checks
# sanity checks
gitflow_check_clean_working_tree
gitflow_require_branches_equal 'develop' 'origin/develop'
gitflow_require_branch_absent "$RELEASE_BRANCH"
git fetch -q $ORIGIN
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
gitflow_require_branch_absent $BRANCH
# All checks passed, ready to roll
git checkout -b "$RELEASE_BRANCH" develop
# create branch
git checkout -b $BRANCH $DEVELOP_BRANCH
echo ""
echo
echo "Summary of actions:"
echo "- A new branch '$RELEASE_BRANCH' was created, based on 'develop'"
echo "- You are now on branch '$RELEASE_BRANCH'"
echo ""
echo "- A new branch '$BRANCH' was created, based on '$DEVELOP_BRANCH'"
echo "- You are now on branch '$BRANCH'"
echo
echo "Follow-up actions:"
echo "- Bump the version number now!"
echo "- Start committing last-minute fixes in preparing your release"
echo "- When done, run:"
echo ""
echo " gitflow finish release '$RELEASE_BRANCH'"
echo
echo " git flow finish release '$VERSION'"
echo
}
finish() {
cmd_finish() {
parse_args "$@"
# Checks
# sanity checks
gitflow_check_clean_working_tree
git fetch -q $ORIGIN
gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
# merge into master
git checkout $MASTER_BRANCH
git merge --no-ff $BRANCH
git tag v$VERSION
git fetch origin develop # TODO: Make a flag to skip these fetches
git fetch origin master # TODO: Make a flag to skip these fetches
gitflow_require_branches_equal 'master' 'origin/master'
gitflow_require_branches_equal 'develop' 'origin/develop'
# merge into develop
git checkout $DEVELOP_BRANCH
git merge --no-ff $BRANCH
# All checks passed, ready to roll
git checkout master
git merge --no-ff "$RELEASE_BRANCH"
git tag "$RELEASE"
git checkout develop
git merge --no-ff "$RELEASE_BRANCH"
git branch -d "$RELEASE_BRANCH"
# delete branch
git branch -d $BRANCH
# TODO: Implement an optional push to master
# git push origin develop; git push origin master; git push --tags origin
echo ""
echo
echo "Summary of actions:"
echo "- Latest objects have been fetched from 'origin'"
echo "- Release branch has been merged into 'master'"
echo "- The release was tagged '$RELEASE'"
echo "- Release branch has been back-merged into 'develop'"
echo "- Release branch '$RELEASE_BRANCH' has been deleted"
echo ""
echo "- Latest objects have been fetched from '$ORIGIN'"
echo "- Release branch has been merged into '$MASTER_BRANCH'"
echo "- The release was tagged 'v$VERSION'"
echo "- Release branch has been back-merged into '$DEVELOP_BRANCH'"
echo "- Release branch '$BRANCH' has been deleted"
echo
}
#!/bin/sh
#
# gitflow -- A collection of Git wrapper scripts to provide high-level
# repository operations for Vincent Driessen's branching model:
#
#
# Original blog post presenting this model is found at:
# http://nvie.com/archives/323
#
#
# Feel free to contribute to this project at:
# http://github.com/nvie/gitflow
#
# Copyright (c) 2010 by Vincent Driessen
# Copyright (c) 2010 by Benedikt Böhm
#
export GITFLOW_DIR=$(dirname "$0")
usage() {
. "$GITFLOW_DIR/gitflow-version"
echo "gitflow, version $GITFLOW_VERSION"
echo ""
echo "usage: gitflow <start|finish> <type> <args>"
echo ""
echo "arguments:"
echo "type can be any of: \"feature\", \"release\", \"hotfix\""
echo ""
echo "usage: git flow start support <version> [<base>]"
}
check_incoming() {
if [ "$ACTION" != "start" -a "$ACTION" != "finish" ]; then
usage
exit 1
fi
if [ "$BTYPE" != "feature" -a "$BTYPE" != "release" -a "$BTYPE" != "hotfix" ]; then
parse_args() {
VERSION="$1"
BASE="${2:-v${VERSION}}"
if [ "$VERSION" = "" ]; then
echo "Missing argument <version>."
usage
exit 1
fi
PREFIX=$(git config --get gitflow.prefix.support || echo support/)
BRANCH=$PREFIX$VERSION
}
if [ $# -lt 2 ]; then
usage
exit 1
fi
# Set & check arguments
ACTION="$1"
BTYPE="$2"
shift 2
check_incoming
# Now, $ACTION and $BTYPE are set
# It's time to call the appropriate subcommand
. "$GITFLOW_DIR/gitflow-sh-setup"
. "$GITFLOW_DIR/gitflow-$BTYPE"
if [ "$ACTION" = "start" ]; then
start "$@"
elif [ "$ACTION" = "finish" ]; then
finish "$@"
else
cmd_help() {
usage
fi
exit 0
}
cmd_start() {
parse_args "$@"
# sanity checks
gitflow_check_clean_working_tree
# create branch
git checkout -b $BRANCH $BASE
# publish branch
git push $ORIGIN $BRANCH:refs/heads/$BRANCH
git fetch -q $ORIGIN
git config branch.$BRANCH.remote $ORIGIN
git config branch.$BRANCH.merge refs/heads/$BRANCH
git co $BRANCH
echo
echo "Summary of actions:"
echo "- A new remote branch '$BRANCH' was created, based on '$BASE'"
echo "- A new tracking branch '$BRANCH' was created"
echo "- You are now on branch '$BRANCH'"
echo
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment