summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/init-git.el9
1 files changed, 9 insertions, 0 deletions
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