Skip to content

Commit f83d3ea

Browse files
authored
Simplify README Git integration setup (#41)
* docs: simplify git integration in readme * docs: clarify optional git aliases
1 parent 8e056ee commit f83d3ea

1 file changed

Lines changed: 10 additions & 18 deletions

File tree

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,34 +62,26 @@ hunk show HEAD~1 # review an earlier commit
6262

6363
## Git integration
6464

65-
Use Hunk directly for full-screen review:
65+
You can set Hunk as your Git pager so `git diff` and `git show` open in Hunk automatically.
6666

67-
```bash
68-
hunk diff
69-
hunk diff --staged
70-
hunk diff main...feature
71-
hunk show
72-
hunk stash show
73-
```
74-
75-
Use Hunk as a Git pager for diff-like output:
67+
From the terminal:
7668

7769
```bash
78-
git config --global core.pager 'hunk patch -'
70+
git config --global core.pager "hunk pager"
7971
```
8072

81-
Or scope it just to `diff` and `show`:
73+
Or in your Git config:
8274

83-
```bash
84-
git config --global pager.diff 'hunk patch -'
85-
git config --global pager.show 'hunk patch -'
75+
```ini
76+
[core]
77+
pager = hunk pager
8678
```
8779

88-
Use Hunk as a Git difftool:
80+
If you’d rather keep Git’s default `diff` and `show` behavior, you can add optional aliases instead:
8981

9082
```bash
91-
git config --global diff.tool hunk
92-
git config --global difftool.hunk.cmd 'hunk difftool "$LOCAL" "$REMOTE" "$MERGED"'
83+
git config --global alias.hdiff "-c core.pager=\"hunk pager\" diff"
84+
git config --global alias.hshow "-c core.pager=\"hunk pager\" show"
9385
```
9486

9587
## Examples

0 commit comments

Comments
 (0)