Function: magit-find-git-config-file

magit-find-git-config-file is an interactive and byte-compiled function defined in magit-files.el.

Signature

(magit-find-git-config-file FILENAME &optional WILDCARDS)

Documentation

Edit a file located in the current repository's git directory.

When ".git", located at the root of the working tree, is a regular file, then that makes it cumbersome to open a file located in the actual git directory.

This command is like find-file, except that it temporarily binds default-directory to the actual git directory, while reading the FILENAME.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-files.el
;;; Find Config File

(defun magit-find-git-config-file (filename &optional wildcards)
  "Edit a file located in the current repository's git directory.

When \".git\", located at the root of the working tree, is a
regular file, then that makes it cumbersome to open a file
located in the actual git directory.

This command is like `find-file', except that it temporarily
binds `default-directory' to the actual git directory, while
reading the FILENAME."
  (interactive
    (let ((default-directory (magit-gitdir)))
      (find-file-read-args "Find file: "
                           (confirm-nonexistent-file-or-buffer))))
  (find-file filename wildcards))