How do you list tracked files (git ls-files) in magit?
ls-tree will output all the versioned files.
--full-tree makes the command run as if you were in the repo's root directory. -r recurses into subdirectories. Combined with --full-tree, this gives you all committed, tracked files.
@tarsius is right about the fact that there is currently no built-in command for doing this.
You can, however, do this:
: ls-files
RET
:
is bound to magit-git-command
which allows you to
Execute a Git subcommand asynchronously, displaying the output. With a prefix argument run Git in the root of the current repository. [...]
You can of course automate the process described above by recording a keyboard macro or defining a custom command and binding it to a key sequence of your choice:
(defun magit-ls-files ()
"List tracked files of current repository."
(interactive)
(if (derived-mode-p 'magit-mode)
(magit-git-command "ls-files" default-directory)
(message "Not in a Magit buffer.")))
(define-key magit-mode-map (kbd "K") 'magit-ls-files)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With