Function: magit-run-git

magit-run-git is a byte-compiled function defined in magit-process.el.

Signature

(magit-run-git &rest ARGS)

Documentation

Call Git synchronously in a separate process, and refresh.

Function magit-git-executable(var)/magit-git-executable(fun) specifies the Git executable and option magit-git-global-arguments specifies constant arguments. The arguments ARGS specify arguments to Git, they are flattened before use.

After Git returns, the current buffer (if it is a Magit buffer) as well as the current repository's status buffer are refreshed.

Process output goes into a new section in the buffer returned by magit-process-buffer. Return the exit code.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-process.el
(defun magit-run-git (&rest args)
  "Call Git synchronously in a separate process, and refresh.

Function `magit-git-executable' specifies the Git executable and
option `magit-git-global-arguments' specifies constant arguments.
The arguments ARGS specify arguments to Git, they are flattened
before use.

After Git returns, the current buffer (if it is a Magit buffer)
as well as the current repository's status buffer are refreshed.

Process output goes into a new section in the buffer returned by
`magit-process-buffer'.  Return the exit code."
  (let ((magit--refresh-cache (list (cons 0 0))))
    (prog1 (magit-call-git args)
      (when (member (car args) '("init" "clone"))
        ;; Creating a new repository invalidates the cache.
        (setq magit--refresh-cache nil))
      (magit-refresh))))