Emacs major modes for Git configuration files
Emacs Lisp
312
705 commits
updated Jun 1, 2026
* Git Config Modes
Emacs major modes for various Git configuration files.
The list of contributors can be found [[https://github.com/magit/git-modes/graphs/contributors][here]].
The following libraries are part of the ~git-modes~ package, which
is available from NonGNU ELPA as well as from Melpa.
** ~gitattributes-mode~
Auto-/loading the library ~gitattributes-mode~ enabled the mode for
~.gitattributes~, ~.git/info/attributes~, and ~git/attributes~ files.
** ~gitconfig-mode~
Auto-/loading the library ~gitconfig-mode~ enables the mode for
~.gitconfig~, ~.git/config~, ~git/config~, and ~.gitmodules~ files.
~gitconfig-mode~ derives from ~conf-unix-mode~.
** ~gitignore-mode~
Auto-/loading the library ~gitignore-mode~ enables the mode for
~.gitignore~, ~.git/info/exclude~, and ~git/ignore~ files.
~gitignore-mode~ derives from ~conf-unix-mode~.
This mode may be of use in other files that don't have anything
to do with Git, for example:
#+begin_src emacs-lisp
(add-to-list 'auto-mode-alist
(cons "/.dockerignore\\'" 'gitignore-mode))
#+end_src
#+html: <br><br>
#+html: <a href="https://github.com/magit/git-modes/actions/workflows/compile.yml"><img alt="Compile" src="https://github.com/magit/git-modes/actions/workflows/compile.yml/badge.svg"/></a>
#+html: <a href="https://elpa.nongnu.org/nongnu/git-modes.html"><img alt="NonGNU ELPA" src="https://emacsair.me/assets/badges/nongnu-elpa.svg"/></a>
#+html: <a href="https://stable.melpa.org/#/git-modes"><img alt="MELPA Stable" src="https://stable.melpa.org/packages/git-modes-badge.svg"/></a>
#+html: <a href="https://melpa.org/#/git-modes"><img alt="MELPA" src="https://melpa.org/packages/git-modes-badge.svg"/></a>
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Emacs Lisp
92.7%
Makefile
7.3%
Emacs major modes for Git configuration files
Emacs Lisp
312
705 commits
updated Jun 1, 2026
* Git Config Modes
Emacs major modes for various Git configuration files.
The list of contributors can be found [[https://github.com/magit/git-modes/graphs/contributors][here]].
The following libraries are part of the ~git-modes~ package, which
is available from NonGNU ELPA as well as from Melpa.
** ~gitattributes-mode~
Auto-/loading the library ~gitattributes-mode~ enabled the mode for
~.gitattributes~, ~.git/info/attributes~, and ~git/attributes~ files.
** ~gitconfig-mode~
Auto-/loading the library ~gitconfig-mode~ enables the mode for
~.gitconfig~, ~.git/config~, ~git/config~, and ~.gitmodules~ files.
~gitconfig-mode~ derives from ~conf-unix-mode~.
** ~gitignore-mode~
Auto-/loading the library ~gitignore-mode~ enables the mode for
~.gitignore~, ~.git/info/exclude~, and ~git/ignore~ files.
~gitignore-mode~ derives from ~conf-unix-mode~.
This mode may be of use in other files that don't have anything
to do with Git, for example:
#+begin_src emacs-lisp
(add-to-list 'auto-mode-alist
(cons "/.dockerignore\\'" 'gitignore-mode))
#+end_src
#+html: <br><br>
#+html: <a href="https://github.com/magit/git-modes/actions/workflows/compile.yml"><img alt="Compile" src="https://github.com/magit/git-modes/actions/workflows/compile.yml/badge.svg"/></a>
#+html: <a href="https://elpa.nongnu.org/nongnu/git-modes.html"><img alt="NonGNU ELPA" src="https://emacsair.me/assets/badges/nongnu-elpa.svg"/></a>
#+html: <a href="https://stable.melpa.org/#/git-modes"><img alt="MELPA Stable" src="https://stable.melpa.org/packages/git-modes-badge.svg"/></a>
#+html: <a href="https://melpa.org/#/git-modes"><img alt="MELPA" src="https://melpa.org/packages/git-modes-badge.svg"/></a>
Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.
Emacs Lisp
92.7%
Makefile
7.3%