2025-12-16 10:20:31 -07:00
|
|
|
# jj duplicate
|
|
|
|
|
|
|
|
|
|
> Create new changes with the same content as existing ones.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://docs.jj-vcs.dev/latest/cli-reference/#jj-duplicate>.
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Duplicate the current revision onto its existing parent:
|
|
|
|
|
|
|
|
|
|
`jj duplicate`
|
|
|
|
|
|
|
|
|
|
- Duplicate a specific revision onto its existing parent:
|
|
|
|
|
|
|
|
|
|
`jj duplicate {{revset}}`
|
|
|
|
|
|
|
|
|
|
- Duplicate a revision onto a different parent:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`jj duplicate {{[-d|--destination]}} {{dest_revset}} {{revset}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Duplicate a revision and insert it after other revision(s):
|
2025-12-16 10:20:31 -07:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`jj duplicate {{[-A|--insert-after]}} {{after_revset}} {{revset}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Duplicate a revision and insert it before other revision(s):
|
2025-12-16 10:20:31 -07:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`jj duplicate {{[-B|--insert-before]}} {{before_revset}} {{revset}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Duplicate onto multiple parents (creates a merge commit):
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`jj duplicate {{[-d|--destination]}} {{destination1}} {{[-d|--destination]}} {{destination2}} {{revset}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Duplicate multiple revisions:
|
|
|
|
|
|
|
|
|
|
`jj duplicate {{revset1 revset2 ...}}`
|