This is a very basic but I have been unable to find the answer on the web. Is it possible to git rm, i.e. to remove a tracked file, from magit?

Thanks

Magit does not provide a command that does git rm (but if you opened a feature request, then I would probably add it eventually).

Meanwhile you can delete the file using some other method, e.g. using M-x delete-file RET <file> RET. Once you have done that refresh the Magit buffer using g and then stage the "deletion" of the file by moving to it in the list of unstaged changes and then pressing s.

Magit doesn't support git rm. Instead, delete the folder in dired, and then stage the change.

You can also use ! to launch any git command.

  • 12
    K (magit-file-untrack) does git rm --cached – npostavs Jun 19 '16 at 13:41
  • This 'K' key is very usefull. Thanks. – wizmer Jun 21 '16 at 1:34

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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