Skip to content

Commit

Permalink
docs: Simplify instructions for using private commits
Browse files Browse the repository at this point in the history
The current instructions ask the reader to convert the merge commit into
a single-parent commit, then create a new merge.

It is probably simpler to follow instructions for inserting a new commit
before the merge commit.
  • Loading branch information
jennings committed Oct 26, 2024
1 parent 891fa88 commit 95283dd
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,21 @@ Now you're ready to work:
- The private commit _wwwwwwww_ is the second parent of the merge commit.
- The working copy (_vvvvvvvv_) contains changes from both.

As you work, squash your changes using `jj squash --into xxxxxxxx`. Or you can
keep your changes in a separate commit without the private commit _wwwwwwww_ as a
parent:
As you work, squash your changes using `jj squash --into xxxxxxxx`.

If you need a new empty commit on top of `xxxxxxxx` you can use the
`--insert-after` and `--insert-before` options (`-A` and `-B` for short):

```shell
# Remove the private commit as a parent
$ jj rebase -r vvvvvvvv -d xxxxxxxx
# Insert a new commit after xxxxxxxx
$ jj new --no-edit -A xxxxxxxx -m "Another feature"
Working copy now at: uuuuuuuu 1c3cff09 (empty) Another feature
Parent commit : xxxxxxxx ef612875 Add new feature

# Create a new merge commit to work in
$ jj new vvvvvvvv wwwwwwww
# Insert a new commit between yyyyyyyy and vvvvvvvv
$ jj new --no-edit -A yyyyyyyy -B vvvvvvvv -m "Yet another feature"
Working copy now at: tttttttt 938ab831 (empty) Yet another feature
Parent commit : yyyyyyyy b624cf12 Existing work
```

To avoid pushing change _wwwwwwww_ by mistake, use the configuration
Expand Down

0 comments on commit 95283dd

Please sign in to comment.