git_commit
git_commit stages changes and creates a commit in an existing project-relative Git repository. It returns a dependency and does nothing when no staged tree changes exist, making repeated runs safe by default.
When available on the host PATH, the Git CLI creates commits and honors host configuration, hooks, and signing setup. xx falls back to go-git when the Git CLI is unavailable. The fallback supports file-based OpenPGP and SSH signing plus SSH-agent keys; its signing key and passphrase support is narrower than the Git CLI.
Arguments
| Argument | Required | Description |
|---|---|---|
message | Yes | Commit message. |
repository | No | Project-relative Git worktree directory. Defaults to .. |
paths | No | Repository-relative paths to stage. Defaults to all changes, including untracked files and deletions. |
author_name | No | Commit author name. Must be used with author_email. Defaults to Git configuration. |
author_email | No | Commit author email. Must be used with author_name. Defaults to Git configuration. |
allow_empty | No | Create a commit when tree has no changes. Defaults to False. |
deps | No | Dependencies to complete before staging and committing. |
Example
load("@git@1", "git_commit")
commit = git_commit(
repository=".xx/output",
message="Update generated files",
author_name="xx",
author_email="[email protected]",
deps=[generate],
)