Function: magit-commit

magit-commit is an autoloaded, interactive and byte-compiled function defined in magit-commit.el.

Signature

(magit-commit)

Documentation

Create a new commit or replace an existing commit.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-commit.el
;;; Popup

;;;###autoload(autoload 'magit-commit "magit-commit" nil t)
(transient-define-prefix magit-commit ()
  "Create a new commit or replace an existing commit."
  :info-manual "(magit)Initiating a Commit"
  :man-page "git-commit"
  :value '("--verbose")
  ["Arguments"
   ("-a" "Stage all modified and deleted files"   ("-a" "--all"))
   ("-e" "Allow empty commit"                     "--allow-empty")
   ("-v" "Show diff of changes to be committed"   ("-v" "--verbose"))
   ("-n" "Disable hooks"                          ("-n" "--no-verify"))
   ("-R" "Claim authorship and reset author date" "--reset-author")
   (magit:--author :description "Override the author")
   (magit-commit:--date :level 7)
   (magit:--gpg-sign :level 5)
   (magit:--signoff)
   (magit-commit:--reuse-message)]
  [["Create"
    ("c" "Commit"         magit-commit-create)]
   ["Edit HEAD"
    ("e" "Extend"         magit-commit-extend)
    ""
    ("a" "Amend"          magit-commit-amend)
    ""
    ("w" "Reword"         magit-commit-reword)
    ("d" "Reshelve"       magit-commit-reshelve :level 0)]
   ["Edit"
    ("f" "Fixup"          magit-commit-fixup)
    ("s" "Squash"         magit-commit-squash)
    ("A" "Alter"          magit-commit-alter)
    ("n" "Augment"        magit-commit-augment)
    ("W" "Revise"         magit-commit-revise)]
   ["Edit and rebase"
    ("F" "Instant fixup"  magit-commit-instant-fixup)
    ("S" "Instant squash" magit-commit-instant-squash)
    ""
    ""
    ("R" "Reword past"    magit-rebase-reword-commit :level 0)]
   ["Spread across commits"
    ("x" "Modified files"  magit-commit-autofixup :level 6)
    ("X" "Updated modules" magit-commit-absorb-modules :level 6)]]
  (interactive)
  (if-let ((buffer (magit-commit-message-buffer)))
      (switch-to-buffer buffer)
    (transient-setup 'magit-commit)))