Every add, edit, and delete inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xwmx/nb/llms.txt
Use this file to discover all available pages before exploring further.
nb is silently committed to the notebook’s local Git repository. This means that the complete revision history of every note is always available — no manual saves, no separate backup step, and no third-party service required. You can browse the history of a single note or an entire notebook, inspect exactly when changes were made, and see which author made them.
How nb Records History
Whenever a note is added, modified, or deleted,nb automatically runs a git commit in the background with a generated message describing the operation. The commit records the exact content of the file at that moment, producing a permanent, auditable timeline for every item in the notebook.
Viewing History
Usenb history to open the git log for a specific note or for the entire notebook. By default nb history uses git log; when tig is installed it is used automatically for an interactive, ncurses-based log viewer.
Timestamps: Added and Updated
nb derives timestamps from the Git log rather than the filesystem’s modification time. Use nb show with the --added and --updated flags to query these timestamps directly:
--added/-a— displays the datetime of the first Git commit that contains the file.--updated/-u— displays the datetime of the most recent Git commit in which the file was modified.
These timestamps reflect Git commit times, not the filesystem’s
mtime. They accurately represent when nb recorded a change, regardless of any filesystem operations that may have occurred outside of nb.Authorship
By default, commits are attributed to the email and name configured in your global Git configuration. You can list the authors of any note withnb show --authors:
Changing Author Information for a Notebook
Override the commit author for a specific notebook usingnb notebooks author:
--email and --name directly:
Setting Author at Notebook Creation
To use a custom author from the very first commit, pass--author (or --email / --name) when creating the notebook:
Manual Checkpoints
Whilenb commits automatically, you can create a named checkpoint at any time using nb git checkpoint. This is useful for marking a meaningful milestone before a major rewrite:
nb git checkpoint also triggers a sync with the remote if auto_sync is enabled.
Running Git Commands Directly
For any operation not covered bynb’s own commands, run Git directly inside the notebook with nb git:
Checking for Uncommitted Changes
nb git dirty exits with status 0 if the notebook has uncommitted changes, and 1 if it is clean — making it easy to use in shell scripts: