Editing any reachable commit and rebasing immediately

These commands create a new commit, which targets an existing commit, from the staged changes. Any commit that is reachable from HEAD, including HEAD itself, can be the target.

The new commit is immediately squashed into its target commit, using an --autosquash rebase.

The command descriptions below mention the specific arguments they use when calling git commit. The arguments specified in the menu are appended to those arguments when calling git commit.

c F (magit-commit-instant-fixup)

This command creates a fixup commit, targeting the reachable commit at point, if any. Otherwise the user is prompted for a commit. Then it instantly performs a rebase, to squash the new commit into the targeted commit.

The original commit message of the targeted commit is left untouched.

This command calls git commit --fixup=COMMIT --no-edit and then git rebase --autosquash MERGE-BASE.

c S (magit-commit-instant-squash)

This command creates a squash commit, targeting the reachable commit at point, if any. Otherwise the user is prompted for a commit. Then it instantly performs a rebase, to squash the new commit into the targeted commit.

During the rebase phase the user is asked to author the final commit message, based on the original message of the targeted commit.

This command calls git commit --squash=COMMIT --no-edit and then git rebase --autosquash MERGE-BASE.