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


5.1 Status Buffer

While other Magit buffers contain e.g. one particular diff or one particular log, the status buffer contains the diffs for staged and unstaged changes, logs for unpushed and unpulled commits, lists of stashes and untracked files, and information related to the current branch.

During certain incomplete operations – for example when a merge resulted in a conflict – additional information is displayed that helps proceeding with or aborting the operation.

The command magit-status displays the status buffer belonging to the current repository in another window. This command is used so often that it should be bound globally. We recommend using C-x g:

(global-set-key (kbd "C-x g") 'magit-status)
C-x g     (magit-status)

Show the status of the current Git repository in a buffer. With a prefix argument prompt for a repository to be shown. With two prefix arguments prompt for an arbitrary directory. If that directory isn’t the root of an existing repository, then offer to initialize it as a new repository.

User Option: magit-repository-directories

List of directories that are or contain Git repositories. Each element has the form (DIRECTORY . DEPTH) or, for backward compatibility, just DIRECTORY. DIRECTORY has to be a directory or a directory file-name, a string. DEPTH, an integer, specifies the maximum depth to look for Git repositories. If it is 0, then only add DIRECTORY itself. For elements that are strings, the value of option magit-repository-directories-depth specifies the depth.

User Option: magit-repository-directories-depth

The maximum depth to look for Git repositories. This option is obsolete and only used for elements of the option magit-repository-directories (which see) that don’t specify the depth directly.

Command: ido-enter-magit-status

From an Ido prompt used to open a file, instead drop into magit-status. This is similar to ido-magic-delete-char, which, despite its name, usually causes a Dired buffer to be created.

To make this command available, use something like:

(add-hook 'ido-setup-hook
          (lambda ()
            (define-key ido-completion-map
              (kbd \"C-x g\") 'ido-enter-magit-status)))

Starting with Emacs 25.1 the Ido keymaps are defined just once instead of every time Ido is invoked, so now you can modify it like pretty much every other keymap:

(define-key ido-common-completion-map
  (kbd \"C-x g\") 'ido-enter-magit-status)

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