9

In Magit, how can I cancel a git process that is taking too long?

If I did something like git push from a terminal, I could press control-C to cancel. How can I do this from Magit?

1
  • M-x list-processes, select the process to be killed (with the cursor or the mouse), press the letter d to delete the process at point.
    – lawlist
    Feb 18, 2016 at 3:35

2 Answers 2

9

You can use M-x magit-process-kill in the Magit process buffer ($, or M-x magit-process-buffer jumps to process buffer for the current repository).

magit-process-kill is an interactive Lisp closure in `magit-process.el'.

(magit-process-kill)

Kill the process at point.
1
  • 1
    In Magit's process buffer, magit-process-kill is bound to k. Jun 27, 2023 at 8:24
5

Type $ in the Magit Status buffer to open Magit's process buffer , and then kill this buffer. Emacs will ask you whether to kill the process.

5
  • 3
    Or M-: (kill-process) to do so without killing the buffer. See also stackoverflow.com/q/10627289
    – phils
    Feb 18, 2016 at 11:28
  • @phils Ah, nice, I didn't know that.
    – user227
    Feb 18, 2016 at 11:34
  • 4
    There is also magit-process-kill, could also be useful
    – npostavs
    Feb 18, 2016 at 16:04
  • Although this does work, I don't want to lose my history of underlying git commands.
    – tboyce12
    Feb 18, 2016 at 23:30
  • @npostavs I think your comment is the best answer. If you move it to an answer then I will accept it :). Thanks everyone for the quick responses!
    – tboyce12
    Feb 18, 2016 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.