From 87a2c26d425f83cc053aaa4b46fb15a88bd9d6ce Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 1 Dec 2014 22:39:07 -0500 Subject: Add command magit-ff-merge-upstream --- lisp/init-git.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp/init-git.el') diff --git a/lisp/init-git.el b/lisp/init-git.el index a166c60..f50237e 100644 --- a/lisp/init-git.el +++ b/lisp/init-git.el @@ -48,6 +48,14 @@ function for calling from outside Magit buffers." (interactive) (magit-commit-extend '("--all"))) +(defun km/magit-ff-merge-upstream () + "Perform fast-forward merge of upstream branch. +\n(git merge --no-edit --ff-only )" + (interactive) + (--if-let (magit-get-tracked-branch) + (magit-merge it '("--ff-only")) + (user-error "No upstream branch"))) + (defun km/magit-stage-file-intent (file) "Stage FILE but not its content. With a prefix argument or when there is no file at point ask for @@ -158,6 +166,8 @@ START-POINT set to the current branch. ?a "Push all" 'km/magit-push-all) (magit-define-popup-action 'magit-push-popup ?h "Push HEAD" 'km/magit-push-head) + (magit-define-popup-action 'magit-merge-popup + ?u "Merge upstream" 'km/magit-ff-merge-upstream) (magit-define-popup-action 'magit-log-popup ?a "All branches" 'km/magit-log-all-branches) (magit-define-popup-action 'magit-branch-popup -- cgit v1.2.3