Skip to content

Commit 9281fb3

Browse files
committed
Improve commands
1 parent ce8bbc6 commit 9281fb3

46 files changed

Lines changed: 755 additions & 129 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/commands/git-ls-remote.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ _REFS_
5151
**--exit-code**
5252
> Exit with error if no refs found.
5353
54+
**--symref**
55+
> Show underlying ref for symbolic refs (e.g. what HEAD points to).
56+
5457
**--help**
5558
> Display help information.
5659
@@ -71,3 +74,13 @@ git ls-remote is a core **Git** command for inspecting remote references, useful
7174
# SEE ALSO
7275

7376
[git-remote](/man/git-remote)(1), [git-fetch](/man/git-fetch)(1), [git-ls-tree](/man/git-ls-tree)(1)
77+
78+
# RESOURCES
79+
80+
```[Source code](https://github.com/git/git)```
81+
82+
```[Homepage](https://git-scm.com/)```
83+
84+
```[Documentation](https://git-scm.com/docs/git-ls-remote)```
85+
86+
<!-- verified: 2026-07-17 -->

assets/commands/git-ls-tree.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,13 @@ git ls-tree is a core **Git** plumbing command for examining tree objects, part
7474
# SEE ALSO
7575

7676
[git-ls-files](/man/git-ls-files)(1), [git-ls-remote](/man/git-ls-remote)(1), [git-show](/man/git-show)(1)
77+
78+
# RESOURCES
79+
80+
```[Source code](https://github.com/git/git)```
81+
82+
```[Homepage](https://git-scm.com/)```
83+
84+
```[Documentation](https://git-scm.com/docs/git-ls-tree)```
85+
86+
<!-- verified: 2026-07-17 -->

assets/commands/git-magic.md

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,75 @@
11
# TAGLINE
22

3-
Display advanced usage tips
3+
Commit changes with an auto-generated commit message
44

55
# TLDR
66

7-
**Show git magic help**
7+
**Commit staged changes** with a generated message
88

99
```git magic```
1010

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+
1131
# SYNOPSIS
1232

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.
1454
1555
# DESCRIPTION
1656

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.
1860

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.
2064

2165
# SEE ALSO
2266

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 -->

assets/commands/git-mailinfo.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ git mailinfo is part of **Git's** email patch workflow, supporting the patch-by-
5656
# SEE ALSO
5757

5858
[git-am](/man/git-am)(1), [git-mailsplit](/man/git-mailsplit)(1)
59+
60+
# RESOURCES
61+
62+
```[Source code](https://github.com/git/git)```
63+
64+
```[Homepage](https://git-scm.com/)```
65+
66+
```[Documentation](https://git-scm.com/docs/git-mailinfo)```
67+
68+
<!-- verified: 2026-07-17 -->

assets/commands/git-mailsplit.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ git mailsplit is part of **Git's** email patch workflow, breaking mailboxes into
5656
# SEE ALSO
5757

5858
[git-am](/man/git-am)(1), [git-mailinfo](/man/git-mailinfo)(1)
59+
60+
# RESOURCES
61+
62+
```[Source code](https://github.com/git/git)```
63+
64+
```[Homepage](https://git-scm.com/)```
65+
66+
```[Documentation](https://git-scm.com/docs/git-mailsplit)```
67+
68+
<!-- verified: 2026-07-17 -->

assets/commands/git-merge-index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ The command passes file information (including base, ours, and theirs versions w
3636
# SEE ALSO
3737

3838
[git-merge](/man/git-merge)(1), [git-mergetool](/man/git-mergetool)(1)
39+
40+
# RESOURCES
41+
42+
```[Source code](https://github.com/git/git)```
43+
44+
```[Homepage](https://git-scm.com/)```
45+
46+
```[Documentation](https://git-scm.com/docs/git-merge-index)```
47+
48+
<!-- verified: 2026-07-17 -->

assets/commands/git-merge-repo.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,28 @@ _DIRECTORY_
3232
3333
# DESCRIPTION
3434

35-
**git merge-repo** merges another repository into a subdirectory while preserving its full commit history. It handles the complex process of combining two separate repository histories with directory relocation.
35+
**git merge-repo** merges another repository into a subdirectory while preserving its full commit history. It is a thin wrapper around `git subtree add -P <directory> <repo> <branch>`, so the incoming history is grafted in rather than squashed away.
36+
37+
Passing `.` as the directory is a special case: the repo is first added into a temporary subdirectory, then its files are moved up into the repository root (flattening it) instead of staying nested.
3638

3739
The command is useful for incorporating external libraries, consolidating multiple repositories into a monorepo, or absorbing a project that was previously maintained separately.
3840

3941
# CAVEATS
4042

41-
Part of git-extras package. Complex operation. May need conflict resolution.
43+
Part of git-extras package. Requires `git subtree` to be available. May need conflict resolution if paths collide.
4244

4345
# HISTORY
4446

4547
git merge-repo is part of **git-extras**, providing repository consolidation functionality for monorepo creation and library incorporation.
4648

4749
# SEE ALSO
4850

49-
[git-merge](/man/git-merge)(1), [git-subtree](/man/git-subtree)(1)
51+
[git-merge](/man/git-merge)(1), [git-subtree](/man/git-subtree)(1), [git-extras](/man/git-extras)(1)
52+
53+
# RESOURCES
54+
55+
```[Source code](https://github.com/tj/git-extras)```
56+
57+
```[Documentation](https://github.com/tj/git-extras/blob/master/Commands.md#git-merge-repo)```
58+
59+
<!-- verified: 2026-07-17 -->

assets/commands/git-mergetool--lib.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@ git-mergetool--lib is part of **Git's** internal infrastructure, providing share
2929
# SEE ALSO
3030

3131
[git-mergetool](/man/git-mergetool)(1), [git-difftool](/man/git-difftool)(1)
32+
33+
# RESOURCES
34+
35+
```[Source code](https://github.com/git/git)```
36+
37+
```[Homepage](https://git-scm.com/)```
38+
39+
```[Documentation](https://git-scm.com/docs/git-mergetool--lib)```
40+
41+
<!-- verified: 2026-07-17 -->

assets/commands/git-mergetool.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ _FILE_
4545
**--prompt**
4646
> Prompt before each file.
4747
48+
**-g**, **--gui**
49+
> Use `merge.guitool` instead of `merge.tool`.
50+
4851
**--help**
4952
> Display help information.
5053
@@ -78,3 +81,13 @@ git mergetool is a core **Git** command providing integration with external merg
7881
# SEE ALSO
7982

8083
[git-merge](/man/git-merge)(1), [git-difftool](/man/git-difftool)(1), [vimdiff](/man/vimdiff)(1)
84+
85+
# RESOURCES
86+
87+
```[Source code](https://github.com/git/git)```
88+
89+
```[Homepage](https://git-scm.com/)```
90+
91+
```[Documentation](https://git-scm.com/docs/git-mergetool)```
92+
93+
<!-- verified: 2026-07-17 -->

assets/commands/git-mktree.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Create tree object from ls-tree format
3838

3939
**git mktree** creates a tree object from ls-tree formatted input. It reads file modes, object types, hashes, and names from stdin, creating a new tree object containing those entries. The command is the inverse of `git ls-tree`.
4040

41-
This plumbing tool enables programmatic tree creation and manipulation in scripts. Input must be properly formatted with each line specifying mode, type, hash, and filename.
41+
This plumbing tool enables programmatic tree creation and manipulation in scripts. Input must be properly formatted with each line specifying mode, type, hash, and filename. With `--batch`, it accepts multiple tree descriptions separated by blank lines and writes one tree object per batch, printing each resulting hash.
4242

4343
# CAVEATS
4444

@@ -51,3 +51,13 @@ git mktree is a core **Git** plumbing command for tree object creation, enabling
5151
# SEE ALSO
5252

5353
[git-ls-tree](/man/git-ls-tree)(1), [git-write-tree](/man/git-write-tree)(1)
54+
55+
# RESOURCES
56+
57+
```[Source code](https://github.com/git/git)```
58+
59+
```[Homepage](https://git-scm.com/)```
60+
61+
```[Documentation](https://git-scm.com/docs/git-mktree)```
62+
63+
<!-- verified: 2026-07-17 -->

0 commit comments

Comments
 (0)