Starting with v2.4
(or "a few days ago" if you use Melpa (non-stable, i.e. a development snapshot)) Magit supports the push-remote in addition to the upstream branch.
You should read the Branching info node to learn about the push-remote, how it is different from the upstream, and how to configure it all. I'll likely write a tutorial about branching before releasing v2.4
, and also update this answer.
Edit: You can get the P P binding back if you really want to:
(magit-change-popup-key 'magit-push-popup :action ?p ?P)
and to restore the other same-key-twice bindings
(magit-change-popup-key 'magit-fetch-popup :action ?u ?f)
(magit-change-popup-key 'magit-pull-popup :action ?u ?F)
(magit-change-popup-key 'magit-rebase-popup :action ?e ?r)
But that has downsides too:
This just restores the bindings, the commands they are bound to by this are not in all cases identical to the old commands. For example P P used to push to the configured upstream or if no upstream was configured it asked where to push to. Now it pushes to the push-remote or if that is undefined, it offers to set the push-remote and then pushes to it.
While it will take some time to get used to, the new default bindings also have the potential to make it into muscle memory. I think it is a nice property of the new bindings, that from all of these popups p will do something with the push-remote and u will do something with the upstream branch.
Another alternative would be:
(magit-define-popup-action 'magit-push-popup ?P
'magit-push-implicitly--desc
'magit-push-implicitly ?p t)
(define-key magit-mode-map "f" 'magit-pull-and-fetch-popup)
(define-key magit-mode-map "F" nil)
With that, P P would once more push to "the most reasonable place possible". Again this is not the same command these keys were previously bound to, but this might be an approach that users who do not want to use the push-remote might like. This command just calls git push
without a refspec, so what will happen depends on a variety of Git variables. (For that reason I consider it to be somewhat risky and don't add it to the popup by default.) See the doc-string for more information.
And it would once more be possible to fetch by pressing the same key twice (but that key would be f, not F and that would also fetch all remotes instead of just the current remote as before).
P u
bound?P e
to set the upstream branch, and thenP u
to push to it afterwards. Same goes for the fetch commands. I prefered the old way, but I have quickly gotten used to the new way too.