summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2019-10-10 18:24:56 -0400
committerKyle Meyer <kyle@kyleam.com>2019-10-10 18:28:28 -0400
commit4da0bef75120ddbee64f6d80b4ead18d3dde2b3f (patch)
tree15df3d5ef4addbbb6b1c2025e8cf08a94f6e9cc3 /lisp
parentab3e8ebab64dca73811be3ce5035622ff7405e1f (diff)
downloademacs.d-4da0bef75120ddbee64f6d80b4ead18d3dde2b3f.tar.gz
magit: Add "checkout detached" command
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 038e7d6..a04a15a 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -191,6 +191,11 @@ namespace."
(interactive)
(magit-run-git "checkout" "master"))
+(defun km/magit-checkout-detached (branch)
+ "Check out commit pointed to by BRANCH."
+ (interactive (list (magit-read-branch "Branch")))
+ (magit-run-git "checkout" (concat branch "^0")))
+
(defun km/magit-branch-and-checkout-from-current (branch)
"Create and check out BRANCH at the current branch.
This is equivalent to running `magit-branch-and-checkout' with