|
1 | 1 | # TAGLINE |
2 | 2 |
|
3 | | -Display advanced usage tips |
| 3 | +Commit changes with an auto-generated commit message |
4 | 4 |
|
5 | 5 | # TLDR |
6 | 6 |
|
7 | | -**Show git magic help** |
| 7 | +**Commit staged changes** with a generated message |
8 | 8 |
|
9 | 9 | ```git magic``` |
10 | 10 |
|
| 11 | +**Stage all changes** (with confirmation) and commit |
| 12 | + |
| 13 | +```git magic -a``` |
| 14 | + |
| 15 | +**Commit and push** |
| 16 | + |
| 17 | +```git magic -p``` |
| 18 | + |
| 19 | +**Commit and force-push** |
| 20 | + |
| 21 | +```git magic -p -f``` |
| 22 | + |
| 23 | +**Prepend a custom title** before the generated message |
| 24 | + |
| 25 | +```git magic -m "[title]"``` |
| 26 | + |
| 27 | +**Edit the generated message** before committing |
| 28 | + |
| 29 | +```git magic -e``` |
| 30 | + |
11 | 31 | # SYNOPSIS |
12 | 32 |
|
13 | | -**git** **magic** |
| 33 | +**git** **magic** [_-a_] [_-m_ _msg_] [_-e_] [_-p_] [_-f_] |
| 34 | + |
| 35 | +# PARAMETERS |
| 36 | + |
| 37 | +**-a** |
| 38 | +> Stage all changes (after confirmation) before committing. |
| 39 | +
|
| 40 | +**-m** _msg_ |
| 41 | +> Prepend a custom message; the generated summary is appended after it. |
| 42 | +
|
| 43 | +**-e** |
| 44 | +> Open the editor to review the message instead of committing with `--no-edit`. |
| 45 | +
|
| 46 | +**-p** |
| 47 | +> Push after committing. |
| 48 | +
|
| 49 | +**-f** |
| 50 | +> Force-push; only takes effect combined with `-p`. |
| 51 | +
|
| 52 | +**-h** |
| 53 | +> Display usage information. |
14 | 54 |
|
15 | 55 | # DESCRIPTION |
16 | 56 |
|
17 | | -**git magic** displays help and tips for advanced Git usage. This git-extras command provides a quick reference guide for common Git operations, tricks, and advanced techniques directly from the command line. |
| 57 | +**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`). |
| 58 | + |
| 59 | +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. |
18 | 60 |
|
19 | | -The output includes shortcuts, useful aliases, and lesser-known Git features that can improve productivity. It serves as a curated cheat sheet for intermediate Git users looking to expand their knowledge beyond basic commands. |
| 61 | +# CAVEATS |
| 62 | + |
| 63 | +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. |
20 | 64 |
|
21 | 65 | # SEE ALSO |
22 | 66 |
|
23 | | -[git-extras](/man/git-extras)(1), [git-help](/man/git-help)(1) |
| 67 | +[git-commit](/man/git-commit)(1), [git-extras](/man/git-extras)(1) |
| 68 | + |
| 69 | +# RESOURCES |
| 70 | + |
| 71 | +```[Source code](https://github.com/tj/git-extras)``` |
| 72 | + |
| 73 | +```[Documentation](https://github.com/tj/git-extras/blob/master/Commands.md#git-magic)``` |
| 74 | + |
| 75 | +<!-- verified: 2026-07-17 --> |
0 commit comments