Skip to content

zdev commit

Commit the changes already staged in Git. With a project or pull-request record, or before zdev init, zdev adds a stable Zdev-Change-Id trailer. The ID lets you find the same logical change after a rebase changes its Git commit hash.

With a personal or shadow record, the commit gets no trailer, so zdev leaves no trace in the repository’s history. A shadow record’s own commit carries the change ID instead and names the main commit in a Zdev-Source-Commit trailer; see shadow.

After staging the intended files, choose either a short message:

Terminal window
zdev commit -m 'Add the greeting command'

Or a message with a separate explanation:

Terminal window
zdev commit -m 'Add the greeting command' \
--body 'Print a greeting for the supplied name.'
zdev commit --message SUBJECT [--body PARAGRAPH]...

-m is the short form of --message. Repeat --body for separate paragraphs. The command runs git commit against the existing index, so stage the intended source and record files first.

Completing a task is a separate operation: task done records its outcome and validation before you stage and commit the changes. Use change inspect to read the resulting ID. See completion and commit for the workflow.