Next: , Up: Customizing   [Contents][Index]


9.1 Per-Repository Configuration

Magit can be configured on a per-repository level using both Git variables as well as Emacs options.

To set a Git variable for one repository only, simply set it in /path/to/repo/.git/config instead of $HOME/.gitconfig or /etc/gitconfig. See the git-config(1) manpage.

Similarly, Emacs options can be set for one repository only by editing /path/to/repo/.dir-locals.el. See (emacs)Directory Variables. For example to disable automatic refreshes of file-visiting buffers in just one huge repository use this:

If you want to apply the same settings to several, but not all, repositories then keeping the repository-local config files in sync would quickly become annoying. To avoid that you can create config files for certain classes of repositories (e.g. "huge repositories") and then include those files in the per-repository config files. For example: