Skip to content

Commit 63b6777

Browse files
committed
Update README to walk through default workflow
Nobody wants to wait through an asciicast
1 parent 66463e9 commit 63b6777

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,39 @@
22

33
Quickly fix up an old commit using your currently-staged changes.
44

5-
[![asciicast](./static/asciicast.png)](https://asciinema.org/a/SYKj4ztmMJ52cSmGxSF9hHjtl?autoplay=1&t=3)
5+
![usage](./static/full-workflow-simple.gif)
66

77
## Usage
88

99
After installation, just run `git fixup` or `git squash` to perform the related
1010
actions.
1111

12-
Running `git fixup` will check if you have any staged changes (if not it will
13-
prompt you to stage all changes) and then present you with a list of commits
14-
from your current work point (HEAD) to HEAD's upstream. For example, if you are
15-
on `master` and its is `origin/master`, `git fixup` will show all commits
16-
between `master` and `origin/master`. In general this is just what you want,
17-
since you probably shouldn't be editing commits that other people are working
18-
off of.
12+
By default, `git fixup` checks for staged changes and offers to amend an old
13+
commit.
14+
15+
Given a repo that looks like:
16+
17+
![linear-repo](./static/00-initial-state.png)
18+
19+
Running `git fixup` will allow you to edit an old commit:
20+
21+
![linear-repo-fixup](./static/01-selector.gif)
22+
23+
The default behavior will check if your current HEAD commit has an `upstream`
24+
branch and show you only the commits between where you currently are and that
25+
commit. If there is no upstream for HEAD you will see the behavior above.
26+
27+
If you're using a pull-request workflow (e.g. github) you will often have repos that look more like this:
28+
29+
![full-repo](./static/20-initial-full-repo.png)
30+
31+
You can set `GIT_INSTAFIX_UPSTREAM` to a branch name and `git fixup` will only
32+
show changes between HEAD and the merge-base:
33+
34+
![full-repo-fixup](./static/21-with-upstream.gif)
35+
36+
In general this is just what you want, since you probably shouldn't be editing
37+
commits that other people are working off of.
1938

2039
After you select the commit to edit, `git fixup` will apply your staged changes
2140
to that commit without any further prompting or work from you.

static/00-initial-state.png

46.5 KB
Loading

static/01-selector.gif

542 KB
Loading

static/20-initial-full-repo.png

59.6 KB
Loading

static/21-with-upstream.gif

304 KB
Loading

static/full-workflow-simple.gif

188 KB
Loading

0 commit comments

Comments
 (0)