LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-magic

Commit changes with an auto-generated commit message

TLDR

Commit staged changes with a generated message
$ git magic
copy
Stage all changes (with confirmation) and commit
$ git magic -a
copy
Commit and push
$ git magic -p
copy
Commit and force-push
$ git magic -p -f
copy
Prepend a custom title before the generated message
$ git magic -m "[title]"
copy
Edit the generated message before committing
$ git magic -e
copy

SYNOPSIS

git magic [-a] [-m msg] [-e] [-p] [-f]

DESCRIPTION

git magic is a git-extras command that commits changes using an automatically generated commit message built from `git status --porcelain -uno`, so the message ends up listing the files that changed. By default the commit happens without opening an editor (`--no-edit`).Passing `-a` shows `git status`, asks for confirmation, then stages everything before committing. `-m` lets you prepend a real message before the auto-generated summary, `-e` opens an editor to adjust the final message, and `-p` (optionally with `-f` for a force-push) pushes immediately after the commit.

PARAMETERS

-a

Stage all changes (after confirmation) before committing.
-m msg
Prepend a custom message; the generated summary is appended after it.
-e
Open the editor to review the message instead of committing with `--no-edit`.
-p
Push after committing.
-f
Force-push; only takes effect combined with `-p`.
-h
Display usage information.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

CAVEATS

Must be run inside a git working tree; it changes to the repository's top level automatically. The generated message is just a list of changed files, not a meaningful description, so this is best suited for quick WIP commits rather than history you intend to keep readable.

SEE ALSO

RESOURCES

Copied to clipboard
Kai