I went through the documentation, but did not find anything referencing how to save configs for pushing.
The hint is in (info "(magit) Transient Arguments and Buffer Variables")
:
The infix arguments of many of Magit’s transient prefix commands cease
to have an effect once the ‘git’ command that is called with those
arguments has returned. Commands that create a commit are a good
example for this. If the user changes the arguments, then that only
affects the next invocation of a suffix command. If the same transient
prefix command is later invoked again, then the arguments are initially
reset to the default value. This default value can be set for the
current Emacs session or saved permanently, see (transient)Saving
Values. It is also possible to cycle through previously used sets of
arguments using ‘M-p’ and ‘M-n’, see (transient)Using History.
Following the cross-reference to (info "(transient) Saving Values")
:
After setting the infix arguments in a transient, the user can save
those arguments for future invocations.
[...]
‘C-x s’ (‘transient-set’)
This command saves the value of the active transient for this Emacs
session.
‘C-x C-s’ (‘transient-save’)
Save the value of the active transient persistently across Emacs
sessions.
-- User Option: transient-values-file
This file is used to persist the values of transients between Emacs
sessions.
How can I set --force-with-lease
as default when pushing?
Given the abvove, it's sufficient to enable it once, and then persist that setting by invoking C-x C-s
(transient-save
).