Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout a branch after release #244

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions git-flow-release
Expand Up @@ -293,8 +293,11 @@ cmd_finish() {
git push --tags "$ORIGIN" || \
die "Could not push tags to $ORIGIN."
fi
git push "$ORIGIN" :"$BRANCH" || \
die "Could not delete the remote $BRANCH in $ORIGIN."
git ls-remote --exit-code "$ORIGIN" "$BRANCH"
if [ "$?" -eq "0" ]; then
git push "$ORIGIN" :"$BRANCH" || \
die "Could not delete the remote $BRANCH in $ORIGIN."
fi
fi

echo
Expand All @@ -314,6 +317,12 @@ cmd_finish() {
echo "- '$DEVELOP_BRANCH', '$MASTER_BRANCH' and tags have been pushed to '$ORIGIN'"
echo "- Release branch '$BRANCH' in '$ORIGIN' has been deleted."
fi

if [ "$BRANCH_AFTER_RELEASE" != "" ]; then
git checkout "$BRANCH_AFTER_RELEASE"
echo "- Checked out '$BRANCH_AFTER_RELEASE'."
fi

echo
}

Expand Down
1 change: 1 addition & 0 deletions gitflow-common
Expand Up @@ -189,6 +189,7 @@ gitflow_load_settings() {
export MASTER_BRANCH=$(git config --get gitflow.branch.master)
export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop)
export ORIGIN=$(git config --get gitflow.origin || echo origin)
export BRANCH_AFTER_RELEASE=$(git config --get gitflow.branch.afterrelease)
}

#
Expand Down