Pull uses --rebase with prefix arg.
This commit is contained in:
parent
2af1a122e5
commit
861e555983
2 changed files with 9 additions and 6 deletions
8
magit.el
8
magit.el
|
@ -3035,15 +3035,17 @@ update it."
|
|||
(remote (magit-run-git-async "fetch" remote))
|
||||
(t (magit-run-git-async "remote" "update"))))
|
||||
|
||||
(magit-define-command pull ()
|
||||
(interactive)
|
||||
(magit-define-command pull (&optional rebase)
|
||||
"Run git pull against the current remote. With a prefix arg
|
||||
will run pull with --rebase."
|
||||
(interactive "P")
|
||||
(let* ((branch (magit-get-current-branch))
|
||||
(config-branch (and branch (magit-get "branch" branch "merge")))
|
||||
(merge-branch (or config-branch
|
||||
(magit-read-rev (format "Pull from")))))
|
||||
(if (and branch (not config-branch))
|
||||
(magit-set merge-branch "branch" branch "merge"))
|
||||
(magit-run-git-async "pull" "-v")))
|
||||
(apply 'magit-run-git-async `("pull" "-v" ,@(and rebase '("--rebase"))))))
|
||||
|
||||
(eval-when-compile (require 'pcomplete))
|
||||
|
||||
|
|
|
@ -661,9 +661,10 @@ only push the current branch to the remote. In other words, it will run
|
|||
remote if it doesn't exist already. The local branch will be configured
|
||||
so that it pulls from the new remote branch.
|
||||
|
||||
Typing @kbd{f} will run @code{git remote update}. With a prefix arg, it
|
||||
will prompt for the name of the remote to update. Typing @kbd{F} will
|
||||
run @code{git pull}. When you don't have a default branch configured to
|
||||
Typing @kbd{f} will run @code{git remote update}. With a prefix arg,
|
||||
it will prompt for the name of the remote to update. Typing @kbd{F}
|
||||
will run @code{git pull} (with a prefix arg will pull with
|
||||
@code{--rebase}). When you don't have a default branch configured to
|
||||
be pulled into the current one, you will be asked for it.
|
||||
|
||||
If there is a default remote repository for the current branch, Magit
|
||||
|
|
Loading…
Reference in a new issue