I want to rename a number of tracked but unchanged files via magit
. I know that I can use R
(magit-file-rename
). However, magit-status
does not show me unchanged files.
How can I toggle the visibility of the unchanged files?
You can add a section with 'tracked-files' to the git status buffer using
(magit-add-section-hook 'magit-status-sections-hook
#'magit-insert-tracked-files nil t)
(refresh the git-status buffer after adding the hook function).
Read the docstring of magit-add-section-hook
to find how to control the insert location of the new section.
I guess there is no need to 'toggle' it as you can just fold/unfold the section.
Toggling the section is not supported, you would have to write your own function for that.
B.t.w. there is also the vc-dir
command (C-x v d
), which might be more useful for listing files in a single dir (and there is vc-rename-file
also).
vc-dir
, something seems to be wrong with my setup. The VC-Backend, working dir, branch and stash status are OK, but the remote is missing and, more importantly, no files or directories are listed, just ./
.
vc-dir
lets you choose a single directory to list. That's why I mentioned it might be handier 'only' when listing files in a single dir. I am otherwise not sure how it works, I have never used it (just found it while answering here)
Commented
Nov 1, 2022 at 9:33