Back to Sapling

Prev

website/docs/commands/prev.md

latest1.5 KB
Original Source

previous | prev

<!-- @generated SignedSource<<69d3cec3e7c520fd013a11274b63cdf6>> Run `./scripts/generate-command-markdown.py` to regenerate. -->

check out an ancestor commit

Update to an ancestor commit of the current commit. When working with a stack of commits, you can use sl previous to move down your stack with ease.

  • Use the --newest flag to always pick the newest of multiple parents commits. You can set amend.alwaysnewest to true in your global Sapling config file to make this the default.

  • Use the --merge flag to bring along uncommitted changes to the destination commit.

  • Use the --bookmark flag to move to the first ancestor commit with a bookmark.

Examples:

  • Move 1 level down the stack:
sl prev
  • Move 2 levels down the stack:
sl prev 2
  • Move to the bottom of the stack:
sl prev --bottom

arguments

shortnamefullnamedefaultdescription
--newestfalsealways pick the newest parent when a commit has multiple parents
--bottomfalseupdate to the lowest non-public ancestor of the current commit
--bookmarkfalseupdate to the first ancestor with a bookmark
--no-activate-bookmarkfalsedo not activate the bookmark on the destination commit
-C--cleanfalsediscard uncommitted changes (no backup)
-B--move-bookmarkfalsemove active bookmark
-m--mergefalsemerge uncommitted changes
-c--checkfalserequire clean working directory