Next: , Previous: , Up: Running Git   [Contents][Index]


4.7.3 Running Git Manually

While Magit provides many Emacs commands to interact with Git, it does not cover everything. In those cases your existing Git knowledge will come in handy. Magit provides some commands for running arbitrary Git commands by typing them into the minibuffer, instead of having to switch to a shell.

! (magit-run)

This transient prefix command binds the following suffix commands and displays them in a temporary buffer until a suffix is invoked.

! ! (magit-git-command-topdir)

This command reads a command from the user and executes it in the top-level directory of the current working tree.

The string "git " is used as initial input when prompting the user for the command. It can be removed to run another command.

: (magit-git-command)
! p

This command reads a command from the user and executes it in default-directory. With a prefix argument the command is executed in the top-level directory of the current working tree instead.

The string "git " is used as initial input when prompting the user for the command. It can be removed to run another command.

! s (magit-shell-command-topdir)

This command reads a command from the user and executes it in the top-level directory of the current working tree.

! S (magit-shell-command)

This command reads a command from the user and executes it in default-directory. With a prefix argument the command is executed in the top-level directory of the current working tree instead.

User Option: magit-shell-command-verbose-prompt

Whether the prompt, used by the above commands when reading a shell command, shows the directory in which it will be run.

These suffix commands start external gui tools.

! k (magit-run-gitk)

This command runs gitk in the current repository.

! a (magit-run-gitk-all)

This command runs gitk --all in the current repository.

! b (magit-run-gitk-branches)

This command runs gitk --branches in the current repository.

! g (magit-run-git-gui)

This command runs git gui in the current repository.

! m (magit-git-mergetool)

This command runs ‘git mergetool --gui’ in the current repository.

With a prefix argument this acts as a transient prefix command, allowing the user to select the mergetool and change some settings.


Next: Git Executable, Previous: Git Process Status, Up: Running Git   [Contents][Index]