Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a -r flag to git-flow-feature-pull to support pull with rebase

Signed-off-by: Vincent Driessen <vincent@3rdcloud.com>
  • Loading branch information...
commit 56bff9a830faca63a9d916a43034562b3b34f734 1 parent adfd408
@vedang vedang authored committed
Showing with 11 additions and 2 deletions.
  1. +11 −2 git-flow-feature
View
13 git-flow-feature
@@ -50,7 +50,7 @@ usage() {
echo " git flow feature diff [<name|nameprefix>]"
echo " git flow feature rebase [-i] [<name|nameprefix>]"
echo " git flow feature checkout [<name|nameprefix>]"
- echo " git flow feature pull <remote> [<name>]"
+ echo " git flow feature pull [-r] <remote> [<name>]"
}
cmd_default() {
@@ -475,6 +475,7 @@ avoid_accidental_cross_branch_action() {
cmd_pull() {
#DEFINE_string prefix false 'alternative remote feature branch name prefix' p
+ DEFINE_boolean rebase false "pull with rebase" r
parse_remote_name "$@"
if [ -z "$REMOTE" ]; then
@@ -500,7 +501,15 @@ cmd_pull() {
# we already have a local branch called like this, so simply pull the
# remote changes in
- git pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'."
+ if flag rebase; then
+ if ! git pull --rebase -q "$REMOTE" "$BRANCH"; then
+ warn "Pull was aborted. There might be conflicts during rebase or '$REMOTE' might be inaccessible."
+ exit 1
+ fi
+ else
+ git pull -q "$REMOTE" "$BRANCH" || die "Failed to pull from remote '$REMOTE'."
+ fi
+
echo "Pulled $REMOTE's changes into $BRANCH."
else
# setup the local branch clone for the first time
Please sign in to comment.
Something went wrong with that request. Please try again.