Learning center

When a source archive is enough for code review

Use a Git archive when the recipient is authorized to see a tree snapshot and only needs to inspect or build that snapshot. Keep the source commit and the archive’s digest in the handoff record. A reviewer who needs history, blame or a base comparison needs additional material.

Test a build from the exported files#

Suppose a contractor can inspect the controller’s tracked build inputs at an approved commit. The decision is whether the documented build from source works without an internal generated file. Export the tree from that exact commit and give the recipient the expected SHA-256 of the tar file through the approved transfer record.

git archive --format=tar --output=controller-review.tar <approved-commit>
sha256sum controller-review.tar
tar -tf controller-review.tar

Have the recipient list the archive and compare its digest before testing. Inspect paths that the build requires. Git archive honors export-ignore attributes, so a tracked test fixture can be missing from the export. An archive made from a commit or tag also records the commit ID in a format-specific header or comment. Git archive formats and attributes

If the build needs data from LFS or commits from a submodule, agree on how to provide those inputs before treating a failed build as a defect in the proposed code. If a reviewer needs to compare exact commits, choose an authorized history handoff or supply both snapshots.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading