summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-09-12 01:00:20 -0400
committerKyle Meyer <kyle@kyleam.com>2014-09-12 01:00:20 -0400
commitdc5a1c293a85f47f160f28c1268f61134348edfc (patch)
tree817bbe0f8a3a1c51f8c3d91d9dc8fb37a2795f71 /lisp
parent90ca7751ed5ea723a465b73665894e0863988fce (diff)
downloademacs.d-dc5a1c293a85f47f160f28c1268f61134348edfc.tar.gz
Add magit-checkout-master
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-git.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index 5d72ce9..bf7fd1f 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -46,6 +46,12 @@ Useful for non-source code repos (e.g., Org mode note files)."
(interactive)
(magit-run-git "checkout" "-"))
+(defun km/magit-checkout-master ()
+ "Checkout master branch.
+\n(git checkout master)"
+ (interactive)
+ (magit-run-git "checkout" "master"))
+
(defun km/magit-branch-and-checkout-from-current (branch)
"Create and checkout BRANCH at current branch.
This is equivalent to running `magit-branch-and-checkout' with
@@ -100,6 +106,8 @@ START-POINT set to the current branch.
'km/magit-branch-and-checkout-from-current)
(magit-define-popup-action 'magit-branch-popup
?p "Checkout previous" 'km/magit-checkout-previous-branch)
+ (magit-define-popup-action 'magit-branch-popup
+ ?m "Checkout master" 'km/magit-checkout-master)
(setq magit-branch-popup-defaults
(delete "--track" magit-branch-popup-defaults)))