1.1.1
ait snapshot
記錄不可變的儲存庫狀態,並檢視 Snapshot 內容或父級沿革。
適用對象: coding agent 與維護者
角色#
通常由 coding agent 在有界的實作和儲存庫檢查都做完之後建立。檢視 Snapshot 對使用者來說是安全的。
用途#
ait snapshot 記錄不可變的儲存庫狀態,並提供內容、比較、祖先和恢復 這幾類查詢。即使後來的 Change 或收尾目標挪了位置,Snapshot 也保留 它建立時所在的 Line 標識。
語法#
ait snapshot create --message <message>
ait snapshot show <snapshot-id> --files
ait snapshot ancestry <snapshot-id> --ancestors比較 Snapshot 要用兩個不可變的識別符號:
ait snapshot diff <old-snapshot-id> <new-snapshot-id>示例#
ait snapshot create --message "Add accessible password visibility control"驗證透過後,在 Task 工作區裡執行這條命令。普通的 Snapshot 記錄的是 程式碼狀態;單獨寫的 sprint Markdown 仍然歸 Plan 沿革管。
輸出#
create 傳回新的 Snapshot 和它的父級。show 可以帶上完整的檔案清單; 祖先查詢預設是有上限的,除非你明確要求輸出全部。
失敗與恢復#
工作區不乾淨或者放錯了地方,先用 ait status 和 ait diff 查一遍 再重試。回退和重放各自是獨立的顯式入口;替換工作區內容之前,先預覽 一下它們的效果。