Skip to content

Commit

Permalink
docs: add FAQ for why to use new-then-amend over edit
Browse files Browse the repository at this point in the history
  • Loading branch information
khionu committed Mar 7, 2024
1 parent 2661c1b commit c1c8703
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ commit, then run `jj restore --from Y --to @-` to restore the parent commit
to the old state, and `jj restore --from X` to restore the new working-copy
commit to the new state.

### How do I resume working on an existing change?

There are two ways to resume working on an earlier change: `jj new` then `jj amend`,
and `jj edit`. The first is recommended over the second for a few reasons, which
come down to how intentional you are with your changes. If the change you want to
resume working on has a conflict, `jj edit` would restore the state with plain-text
conflict annotations. Editing those annotations incorrectly or by accident can lead
to undefined behaviour during conflict resolution. If you amend a new change onto
a change that contains a conflict, the conflict will be updated to correctly reflect
your new changes.

### How do I deal with divergent changes ('??' after the [change ID])?

A [divergent change][glossary_divergent_change] represents a change that has two
Expand Down

0 comments on commit c1c8703

Please sign in to comment.