From 96bc6b11c883ad8db78f91d4e8036cfd1de1b279 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 18 Nov 2014 22:17:55 -0500 Subject: Add magit-push-head command --- lisp/init-git.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp/init-git.el') diff --git a/lisp/init-git.el b/lisp/init-git.el index 0a033d4..8cfa317 100644 --- a/lisp/init-git.el +++ b/lisp/init-git.el @@ -76,6 +76,13 @@ requiring confirmation. (let ((remote (magit-read-remote "Remote"))) (magit-run-git-async "push" "-v" remote "--all"))) +(defun km/magit-push-head () + "Push current branch to same name on remote. +\n(git push REMOTE HEAD)" + (interactive) + (let ((remote (magit-read-remote "Remote"))) + (magit-run-git-async "push" "-v" remote "HEAD"))) + (defun km/magit-log-all-branches (range &optional args files) (interactive (magit-log-read-args t)) (add-to-list 'args "--all") @@ -154,6 +161,8 @@ START-POINT set to the current branch. ?u "Auto commit" 'km/magit-auto-commit) (magit-define-popup-action 'magit-push-popup ?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-log-popup ?a "All branches" 'km/magit-log-all-branches) (magit-define-popup-action 'magit-branch-popup -- cgit v1.2.3