Next: , Previous: , Up: Transferring   [Contents][Index]


7.4 Pushing

For information about the differences between the upstream and the push-remote, see Branching.

Also see the git-push(1) manpage.

P     (magit-push-popup)

This prefix command shows the following suffix commands along with the appropriate infix arguments in a popup buffer.

P p     (magit-push-current-to-pushremote)

Push the current branch to branch.<name>.pushRemote or if that is unset to remote.pushDefault.

When magit-push-current-set-remote-if-missing is non-nil and the push-remote is not configured, then read the push-remote from the user, set it, and then push to it. With a prefix argument the push-remote can be changed before pushed to it.

P u     (magit-push-current-to-upstream)

Push the current branch to its upstream branch.

When magit-push-current-set-remote-if-missing is non-nil and the push-remote is not configured, then read the upstream from the user, set it, and then push to it. With a prefix argument the push-remote can be changed before pushed to it.

P e     (magit-push-current)

Push the current branch to a branch read in the minibuffer.

P o     (magit-push)

Push an arbitrary branch or commit somewhere. Both the source and the target are read in the minibuffer.

P r     (magit-push-refspecs)

Push one or multiple refspecs to a remote, both of which are read in the minibuffer.

To use multiple refspecs, separate them with commas. Completion is only available for the part before the colon, or when no colon is used.

P m     (magit-push-matching)

Push all matching branches to another repository. If multiple remotes exit, then read one from the user. If just one exists, use that without requiring confirmation.

P t     (magit-push-tags)

Push all tags to another repository. If only one remote exists, then push to that. Otherwise prompt for a remote, offering the remote configured for the current branch as default.

P T     (magit-push-tag)

Push a tag to another repository.

Two more push commands exist, which by default are not available from the push popup. See their doc-strings for instructions on how to add them to the popup.

Command: magit-push-implicitly args

Push somewhere without using an explicit refspec.

This command simply runs git push -v [ARGS]. ARGS are the arguments specified in the popup buffer. No explicit refspec arguments are used. Instead the behavior depends on at least these Git variables: push.default, remote.pushDefault, branch.<branch>.pushRemote, branch.<branch>.remote, branch.<branch>.merge, and remote.<remote>.push.

Command: magit-push-to-remote remote args

Push to the remote REMOTE without using an explicit refspec. The remote is read in the minibuffer.

This command simply runs git push -v [ARGS] REMOTE. ARGS are the arguments specified in the popup buffer. No refspec arguments are used. Instead the behavior depends on at least these Git variables: push.default, remote.pushDefault, branch.<branch>.pushRemote, branch.<branch>.remote, branch.<branch>.merge, and remote.<remote>.push.

User Option: magit-push-current-set-remote-if-missing

This option controls whether missing remotes are configured before pushing.

When nil, then the command magit-push-current-to-pushremote and magit-push-current-to-upstream do not appear in the push popup if the push-remote resp. upstream is not configured. If the user invokes one of these commands anyway, then it raises an error.

When non-nil, then these commands always appear in the push popup. But if the required configuration is missing, then they do appear in a way that indicates that this is the case. If the user invokes one of them, then it asks for the necessary configuration, stores the configuration, and then uses it to push a first time.

This option also affects whether the argument --set-upstream is available in the popup. If the value is non-nil, then that argument is redundant. But note that changing the value of this option does not take affect immediately, the argument will only be added or removed after restarting Emacs.


Next: , Previous: , Up: Transferring   [Contents][Index]