Skip to content

Version control

Recording file history so a quant can compare assumptions, recover earlier work and share changes, while identifying what remains outside that history.

Version control records changes to selected files over time so you can inspect, compare and recover earlier versions. In quant work, it helps answer a concrete question: did a valuation change because someone revised the model code or its saved assumptions? The record gives you versions to investigate; it does not establish that either version is financially correct.

Keep the earlier assumption

Suppose a fictional valuation project stores a decimal rate in risk-config.json. An earlier saved state, labelled C0, contains 0.05. A later saved state, C1, contains 0.04. A comparison exposes the changed input, while the earlier state remains available for inspection. Keeping only the latest file would lose that evidence.
Fictional configuration history retains C0 with decimal rate 0.05 and later C1 with decimal rate 0.04. Both snapshots can be compared. External data, installed environment and secrets are outside this illustrated history.
Fictional configuration history retains C0 with decimal rate 0.05 and later C1 with decimal rate 0.04. Both snapshots can be compared. External data, installed environment and secrets are outside this illustrated history.
The later configuration adds a saved state without overwriting the earlier one. C0 and C1 are diagram labels, not Git object IDs; the rates are fictional decimal inputs.

The change history can carry a reason as well as content: for example, “revise the scenario rate.” That explanation helps a reviewer distinguish an intentional assumption change from an accidental edit. It is still a statement to review, rather than proof that the new rate is appropriate.

Git makes the history explicit

Git is a widely used distributed version-control system. A Git commit records a selected snapshot with metadata and links into the project's history. Editing a working file alone does not create that record. In the usual staging workflow, you select and review the content that will enter the next commit.

These related actions have different roles:

Action or facilityWhat it provides
Save a working fileKeeps the current edit on disk; it need not preserve its predecessor.
Commit locallyRecords the selected version in the local repository. No remote connection is required.
Share through another repositoryTransfers history so colleagues can obtain and review it. A local commit is not automatically shared.
Maintain backupsProtects against loss of the storage holding the work. Local history on a failed disk is not a separate backup.
A repository stores the version history. Git can compare revisions and support separate lines of development that collaborators later combine. Combining changes may require a human to resolve conflicts and check the result. A hosting service adds a place to exchange work and review it; Git's local history does not depend on using a particular host. See Pro Git's discussion of remotes for that sharing boundary.

A code revision is only part of a run

History covers the files whose content was actually recorded. An untracked file, a later uncommitted edit or an externally refreshed market-data file is not recovered merely by selecting an old commit. An ignore rule also does not remove a file already tracked, as the Git ignore documentation explains.
Keep credentials out of project history. Record a usable identifier for external data and preserve the corresponding bytes under an appropriate data-retention process. Record the interpreter, packages, configuration and command needed for a reproducible environment. Versioning a dependency file records that file; it does not preserve every installed package, operating-system dependency or external input automatically.
For a practical next step, the SelfMadeQuant Git lesson walks through reviewing and recording a focused change. Its public preview is open; the full lesson requires membership.

Sources

Last updated
  • git
  • version control
  • reproducibility
  • quant software
← Back to the glossaryBack to top ↑