Skip to content

Magit Statusλ︎

Space g s runs Magit status, showing the status of the local git repository and any attached remote repositories. Magit status is a full Git client and can run any Git commands.

? shows all the command menus available for committing

g r to refresh Magit status buffer

Spacemacs Magit help menu

j and k to move to next / previous line

[ and ] jumps to next / previous section at the current level

Tab to expand a section

Spacemacs Magit Status Example

Using Magit status directlyλ︎

If you run git status from a file that is not currently in a git project, magit will prompt you to create a git project, allowing you to select the root of the project directory

  • confirm you want to create a git repository
  • specify where to create the repository, the root directory for the git repository

Create new project with magit-repository-directories configured

magit-repository-directories can be defined with with a collection of directories, used by helm pop-up menu will list the Git repositories within those directories rather than prompting to create a new repository. Type . as the selection to create a new repository with the current project.

Magit Dispatchλ︎

SPC g m calls magit-dispatch which opens a transient menu with all the Magit commands found in Magit Status buffer. Git commands can be run without the need of the Magit status buffer.

Spacemacs Magit help menu

Magit Status Fullscreenλ︎

Magit status in fullscreen mode provides lots of space to work with changes, look at logs and compare diffs.

Keybinding Description
q returns to previous window layout, keeping the Magit status buffer available.
Space u q kills the magit status buffer and returns to previous layout

Magit fullscreen configured in Enhanced Clojure experience

Magit fullscreen is already configured if you followed the Enhance Clojure experience.

Configure fullscreen for Magit Statusλ︎

Add the git-magit-status-fullscreen t variable to the git layer in .spacemacs to enable Magit fullscreen.

Space f e d opens the Spacemacs configuration file

/ and start typing configuration-layers to search for the dotspacemacs-configuration-layers section. Enter confirms the search text and n jumps to the next occurrence, N jumps to the previous occurrence.

   dotspacemacs-configuration-layers
   '(
     (git :variables
          git-magit-status-fullscreen t)
    )

Reload the configuration or Restart Spacemacsλ︎

For the changes to take effect, either reload the ~/.spacemacs configuration using

Space f e R to reload the Spacemacs configuration or Space q r to restart Spacemacs.