diff --git a/magit.el b/magit.el index 6ca688e9..311e760a 100644 --- a/magit.el +++ b/magit.el @@ -3045,7 +3045,12 @@ typing and automatically refreshes the status buffer." (magit-run-git-async "push" "-v" push-remote (if ref-branch (format "%s:%s" branch ref-branch) - branch)))) + branch)) + ;; Although git will automatically set up the remote, + ;; it doesn't set up the branch to merge (at least as of Git 1.6.6.1), + ;; so we have to do that manually. + (unless ref-branch + (magit-set (concat "refs/heads/" branch) "branch" branch "merge")))) ;;; Log edit mode