Skip to content

Commit

Permalink
develop_branch uses origin/develop_branch as start-point if one exists.
Browse files Browse the repository at this point in the history
By default a local develop branch is created of from master regardless if a origin/develop exits. This problem is discussed in issues nvie#137 and nvie#23.
  • Loading branch information
emreberge committed Nov 28, 2011
1 parent 766159d commit 62c339e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-flow-init
Expand Up @@ -200,7 +200,11 @@ cmd_default() {
# default production branch and develop was "created". We should create
# the develop branch now in that case (we base it on master, of course)
if ! git_local_branch_exists "$develop_branch"; then
git branch --no-track "$develop_branch" "$master_branch"
if git_remote_branch_exists "origin/$develop_branch"; then
git branch "$develop_branch" "origin/$develop_branch" >/dev/null 2>&1
else
git branch --no-track "$develop_branch" "$master_branch"
fi
created_gitflow_branch=1
fi

Expand Down
4 changes: 4 additions & 0 deletions gitflow-common
Expand Up @@ -97,6 +97,10 @@ git_local_branch_exists() {
has $1 $(git_local_branches)
}

git_remote_branch_exists() {
has $1 $(git_remote_branches)
}

git_branch_exists() {
has $1 $(git_all_branches)
}
Expand Down

0 comments on commit 62c339e

Please sign in to comment.