#+title: Magit: The Git Interface #+date: [2024-02-01 Thu] #+filetags: :emacs:git: #+identifier: 20240201T110000 * Why Magit Magit is widely considered the best Git interface ever built. It exposes the full power of Git through a transient-driven UI that requires no memorization of flags. * Essential commands | Key | Action | |---------+---------------------------| | C-x g | Open Magit status | | s / u | Stage / unstage hunk | | c c | Commit | | P p | Push to upstream | | F p | Pull from upstream | | b b | Switch branch | | b c | Create and switch branch | | l l | Show log | | d d | Diff working tree | * Forge: GitHub/GitLab from Emacs #+begin_src emacs-lisp (use-package forge :after magit) #+end_src Lets you open PRs, review issues, and post comments without leaving Emacs. * Configuration #+begin_src emacs-lisp (use-package magit :bind ("C-x g" . magit-status) :config (setq magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) #+end_src