Merge branch 'develop' of github.com:nvie/gitflow into develop
diff --git a/AUTHORS b/AUTHORS
index 3541d3b..1c29754 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -17,5 +17,6 @@
 - Jon Bernard
 - Olivier Mengué
 - Emre Berge Ergenekon
+- Eric Holmes
 
 Portions derived from other open source works are clearly marked.
diff --git a/git-flow-init b/git-flow-init
index d19b651..4afa1c2 100644
--- a/git-flow-init
+++ b/git-flow-init
@@ -117,8 +117,14 @@
 
 		# check existence in case of an already existing repo
 		if [ "$should_check_existence" = "YES" ]; then
-			git_local_branch_exists "$master_branch" || \
+			# if no local branch exists and a remote branch of the same
+			# name exists, checkout that branch and use it for master
+			if ! git_local_branch_exists "$master_branch" && \
+				git_remote_branch_exists "origin/$master_branch"; then
+				git branch "$master_branch" "origin/$master_branch" >/dev/null 2>&1
+			elif ! git_local_branch_exists "$master_branch"; then
 				die "Local branch '$master_branch' does not exist."
+			fi
 		fi
 
 		# store the name of the master branch