Soft resetting.
This commit is contained in:
parent
e9132a53d4
commit
adfb76c91d
1 changed files with 5 additions and 1 deletions
6
magit.el
6
magit.el
|
@ -179,7 +179,7 @@
|
||||||
(define-key magit-keymap (kbd "a") 'magit-stage-thing-at-point)
|
(define-key magit-keymap (kbd "a") 'magit-stage-thing-at-point)
|
||||||
(define-key magit-keymap (kbd "u") 'magit-unstage-thing-at-point)
|
(define-key magit-keymap (kbd "u") 'magit-unstage-thing-at-point)
|
||||||
(define-key magit-keymap (kbd "i") 'magit-ignore-thing-at-point)
|
(define-key magit-keymap (kbd "i") 'magit-ignore-thing-at-point)
|
||||||
(define-key magit-keymap (kbd "x") 'magit-revert-thing-at-point)
|
(define-key magit-keymap (kbd "x") 'magit-reset-soft)
|
||||||
(define-key magit-keymap (kbd "X") 'magit-reset-hard)
|
(define-key magit-keymap (kbd "X") 'magit-reset-hard)
|
||||||
(define-key magit-keymap (kbd "RET") 'magit-visit-thing-at-point)
|
(define-key magit-keymap (kbd "RET") 'magit-visit-thing-at-point)
|
||||||
(define-key magit-keymap (kbd "b") 'magit-switch-branch)
|
(define-key magit-keymap (kbd "b") 'magit-switch-branch)
|
||||||
|
@ -398,6 +398,10 @@
|
||||||
|
|
||||||
;;; Resetting
|
;;; Resetting
|
||||||
|
|
||||||
|
(defun magit-reset-soft (target)
|
||||||
|
(interactive (list (read-string "Reset to: " "HEAD^")))
|
||||||
|
(magit-run "git" "reset" "--soft" target))
|
||||||
|
|
||||||
(defun magit-reset-hard (target)
|
(defun magit-reset-hard (target)
|
||||||
(interactive (list (read-string "Hard reset to: " "HEAD")))
|
(interactive (list (read-string "Hard reset to: " "HEAD")))
|
||||||
(if (yes-or-no-p
|
(if (yes-or-no-p
|
||||||
|
|
Loading…
Reference in a new issue