@@ -1442,6 +1442,58 @@ Suppress status output.
14421442
14431443 Not supported in `copier.yml`.
14441444
1445+ # ## `resolve_commit_to_sha`
1446+
1447+ - Format : ` bool`
1448+ - CLI flags : ` --resolve-commit-to-sha`
1449+ - Default value : ` False`
1450+
1451+ When copying or updating from a Git-versioned template, store the actual SHA commit hash
1452+ in the answers file instead of the Git reference (tag/branch name). This provides an
1453+ immutable reference to the exact template version used, ensuring reproducibility and
1454+ traceability.
1455+
1456+ Storing SHA hashes instead of symbolic references (tags/branches) is useful for :
1457+
1458+ - **Reproducibility**: Ensures the exact same template version can be used across
1459+ different environments
1460+ - **Handling mutable references**: References that change over time (like floating
1461+ tags or branch heads) won't affect existing projects
1462+
1463+ !!! info
1464+
1465+ Template authors can enable this by default in their templates by setting
1466+ `_resolve_commit_to_sha : true` in `copier.yml`. The CLI flag takes precedence
1467+ over the template configuration.
1468+
1469+ !!! example "Usage examples"
1470+
1471+ ` ` ` shell
1472+ # Store immutable reference for reproducible builds
1473+ copier copy --resolve-commit-to-sha --vcs-ref v2.0.0 template destination
1474+
1475+ # Working with a development branch
1476+ copier copy --resolve-commit-to-sha --vcs-ref main template destination
1477+
1478+ # Using a floating tag (stores the current SHA, not the tag)
1479+ copier copy --resolve-commit-to-sha --vcs-ref stable/latest template destination
1480+ ` ` `
1481+
1482+ In all cases, the answers file will contain a SHA hash like `a1b2c3d4e5f6`
1483+ instead of the symbolic reference, ensuring an immutable reference to the
1484+ exact template version.
1485+
1486+ !!! example "Template configuration"
1487+
1488+ Template authors can enable this behavior by default :
1489+
1490+ ` ` ` yaml title="copier.yml"
1491+ _resolve_commit_to_sha: true
1492+ ` ` `
1493+
1494+ This ensures all projects generated from the template will store immutable
1495+ SHA references for better reproducibility and traceability.
1496+
14451497# ## `secret_questions`
14461498
14471499- Format : ` List[str]`
0 commit comments