summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
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