Proposal 1
For any Emacs buffer, you can invoke M-x pwd
in order to display the current working directory, as determined by variable default-directory
.
Proposal 2
The user option magit-buffer-name-format
determines the name of Magit buffers and always contains the format specifier %t
, which corresponds to the top-level directory of the repository's working tree.
The user option magit-uniquify-buffer-names
defaults to t
, which results in %t
expanding to an abbreviated and uniquified representation of the current top-level directory.
If you don't mind the increased hogging of mode line real estate, you can set magit-uniquify-buffer-names
to nil
(e.g. via (setq-default magit-uniquify-buffer-names nil)
) in order to have the full directory path displayed in the mode line (and as part of the name) of each Magit buffer.
Proposal 3
Following Kyle Meyer's suggestion, you could write your own command along the lines of
(defun my-git-pwd (&optional insert)
"Show the toplevel of the current repository.
With prefix argument INSERT, insert the current default directory
at point instead."
(interactive "P")
(magit-with-toplevel
(pwd insert)))
Proposal 4
If you don't want to waste any horizontal space in the mode-line
as suggested in (2), you can instead "waste" a single line in the status buffer itself:
(magit-add-section-hook 'magit-status-headers-hook
'magit-insert-repo-header)
You can control where this additional information appears, see magit-add-section-hook
's doc-string.