Rudy’s OBTF Rudolf Adamkovič

Home / Emacs / Magit / Configure!


Control git version control system (VCS) with magit

Install the package.

(with-eval-after-load 'package
  (add-to-list 'package-selected-packages 'magit))

Experiment.

https://patch-diff.githubusercontent.com/raw/magit/magit/pull/4860.patch

(setopt magit-git-executable "/usr/bin/git")

In logs, show the absolute date instead of the age of commits.

(with-eval-after-load 'magit
  (let ((margin '(t "%Y-%m-%d %H:%M " magit-log-margin-width t 18)))
    (setopt magit-log-margin margin
            magit-reflog-margin margin)))

Show the fill column indicator when writing commit messages.

(with-eval-after-load 'git-commit
  (add-hook 'git-commit-setup-hook
            #'display-fill-column-indicator-mode))

Split the window for git diffs but nothing else.

(with-eval-after-load 'magit
  (setopt magit-display-buffer-function
          #'magit-display-buffer-same-window-except-diff-v1))

Show character-level differences in git diffs.

(with-eval-after-load 'magit
  (setopt magit-diff-refine-hunk 'all))

© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.