diff --git a/magit.el b/magit.el index 82c81d81..c22ed5ef 100644 --- a/magit.el +++ b/magit.el @@ -1024,6 +1024,7 @@ Many Magit faces inherit from this one by default." (define-key map (kbd "x") 'magit-reset-head) (define-key map (kbd "X") 'magit-reset-working-tree) (define-key map (kbd "k") 'magit-discard-item) + (define-key map (kbd "K") 'magit-clean) (define-key map (kbd "RET") 'magit-visit-item) (define-key map (kbd "SPC") 'magit-show-item-or-scroll-up) (define-key map (kbd "DEL") 'magit-show-item-or-scroll-down) @@ -2670,4 +2671,10 @@ Prefix arg means justify as well." (erase-buffer) (shell-command (concat magit-git-executable " branch -va") t t))) +(defun magit-clean () + (interactive) + (if (yes-or-no-p "Remove all untracked files and directories? ") + (magit-run "git" "clean" "-dxf"))) + + (provide 'magit)