Skip to main content

commit

commit | ci

save all pending changes or specified files in a new commit

Commit changes to the given files to your local repository.

By default, all pending changes (in other words, those reported by sl status) are committed. If you want to commit only some of your changes, choose one of the following options:

  • Specify an exact list of files for which you want changes committed.

  • Use the -I or -X flags to match or exclude file names using a pattern or fileset. See sl help patterns and sl help filesets for details.

  • Specify the --interactive flag to open a UI to select individual files, hunks, or lines.

To meld pending changes into the current commit instead of creating a new commit, see sl amend.

If you are committing the result of a merge, such as when merge conflicts occur during sl goto, commit all pending changes. Do not specify files or use -I, -X, or -i.

Specify the -m flag to include a free-form commit message. If you do not specify -m, Sapling opens your configured editor where you can enter a message based on a pre-loaded commit template.

Returns 0 on success, 1 if nothing changed.

If your commit fails, you can find a backup of your commit message in .sl/last-message.txt.

Examples:

  • commit all files ending in .py:
sl commit --include "glob:**.py"
  • commit all non-binary files:
sl commit --exclude "set:binary()"

arguments

shortnamefullnamedefaultdescription
-A--addremovemark new/missing files as added/removed before committing
-e--editinvoke editor on commit messages
-i--interactiveuse interactive mode
-M--reuse-messagereuse commit message from REV
-I--includeinclude files matching the given patterns
-X--excludeexclude files matching the given patterns
-m--messageuse text as commit message
-l--logfileread commit message from file
-d--daterecord the specified date as commit date
-u--userrecord the specified user as committer
--no-move-detectiondisable automatic file move detection