33

The manual's introduction says:

Magit wraps and in many cases improves upon at least the following Git porcelain commands: add, am, bisect, blame, branch, checkout, cherry, cherry-pick, clean, clone, commit, config, describe, diff, fetch, format-patch, init, log, merge, merge-tree, mv, notes, pull, rebase, reflog, remote, request-pull, reset, revert, rm, show, stash, submodule, and tag.

However, I can't quite figure out how to actually move a file from it. Sure I can just run git mv, but taking that to the logical extreme we might as well just use git instead of Magit :P Considering the manual mentions mv, I wonder if that's a mistake or not.

I only found this old question but it's very old by Magit standards. Perhaps things have changed?

Jorge Israel Peña
  • 1,265
  • 9
  • 17

1 Answers1

39

magit-file-rename is bound to R in magit-mode buffers.

tarsius
  • 25,685
  • 4
  • 70
  • 109
asjo
  • 1,067
  • 8
  • 12
  • 13
    Please remember that the Magit status buffer uses context-sensitive keymaps! When the status buffer shows no files (as in: your working tree is clean), you have to move point to the last empty line at the bottom of this buffer and then hit R to execute magit-file-rename. If point is within a line which shows a branch (like master), hitting R will execute magit-branch-rename instead. Took me a while to figure this out. – ack Apr 13 '17 at 14:55
  • The first empty line will also work. Just as long as the point is not on one of the branch names near the top. – Supernormal Nov 29 '21 at 07:45
  • 1
    I was surprised to learn about this command because R doesn't show up in the h help menu (magit-dispatch). I guess it's still necessary to use C-h m to list all the available bindings even with transient. – remcycles Nov 21 '23 at 13:49