The way you are enabling the switches is correct, as evidenced by the fact that they "turn red" when you hit - followed by a letter.
In your case, -u
simply isn't the switch you want. From man git-push
:
-u
, --set-upstream
For every branch that is up to date or successfully pushed, add
upstream (tracking) reference, used by argument-less git-pull
(1)
and other commands. For more information, see branch.<name>.merge
in git-config
(1).
So when you push with the -u
switch enabled, you'll see something like this in the *magit-process*
buffer:
0 git --no-pager -c core.preloadindex=true push -v origin foo:refs/heads/foo -u
Pushing to https://example.com/project.git
Counting objects: 15, done. [...].
Branch foo
set up to track remote branch foo
from origin. [...]
This tells you that Magit did in fact consider the -u
switch.
As @TuDo points out, to get Magit to prompt you for a remote to push to, you need to hit C-u P P.
Switches and Args
In general, when dealing with the menus that Magit provides for different commands it is helpful to remember that switches are just that: switches. You can turn them on and off, and that's it. They don't require you to supply any additional information, so Magit won't prompt you for anything when you turn them on.
Args, on the other hand, do require additional information, so when you tell Magit that you want to run a command with a specific arg it will prompt you accordingly. Args also differ from switches in that they are enabled by hitting = followed by a letter.
P P
.?
key from inside Magit is helpful to show the menu, some keys are still not there. E.g. Tryl h
for reflog. So, I agree with you that a more extensive menu/help is still in need.