Git-Like Workflowο
PT introduces a powerful git-like workflow for file version management, making it easy to track and manage changes across your project.
Workflow Overviewο
The workflow mirrors Gitβs commands:
Check Status - See what files changed
Commit Changes - Backup all modified files
View History - List backups with comments
Compare Changes - Diff with previous versions
Rollback - Restore previous versions
Step-by-Step Workflowο
1. Check File Statusο
See the status of all files in your project:
pt check
Output:
π PT Status (like git status)
myproject/
βββ src/
β βββ main.go (15.2 KB) [modified]
β βββ utils.go (3.4 KB)
βββ config.json (2.1 KB) [new]
βββ old_config.json (1.8 KB) [deleted]
Summary:
1 modified
1 new
1 deleted
Use 'pt commit -m "message"' to backup all changes
Status colors:
Green = Unchanged (matches last backup)
Yellow = Modified (content changed)
Cyan = New (no backup exists yet)
Red = Deleted (backup exists but file gone)
2. Commit All Changesο
Backup all modified and new files with a single command:
pt commit -m "Fixed authentication bug and updated config"
Output:
π¦ Committing changes...
Files to backup:
1. src/main.go [modified]
2. config.json [new]
Commit 2 file(s) with message "Fixed authentication bug and updated config"? (y/N): y
β src/main.go
β config.json
π¦ Commit Summary:
β 2 files backed up
π¬ Message: "Fixed authentication bug and updated config"
Commit Behavior:
Only backs up modified and new files
Skips unchanged files (no backup needed)
All backups tagged with
commit: messageConfirmation prompt before backing up
3. View Commit Historyο
See the history of a specific file:
pt -l src/main.go
Output:
π Backup files for 'src/main.go'
Total: 5 backup(s) (stored in .pt/)
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββ¬βββββββββββ¬βββββββββββββββββββββββββββββββββ
β File Name β Modified β Size β Comment β
ββββββββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββΌβββββββββββββββββββββββββββββββββ€
β 1. main_go.20251118... β 2025-11-18 14:12:41 β 50.5 KB β commit: Fixed authentication β
β 2. main_go.20251118... β 2025-11-18 14:11:24 β 57.0 KB β Working version before refactorβ
β 3. main_go.20251118... β 2025-11-18 13:43:01 β 52.6 KB β commit: Initial implementation β
ββββββββββββββββββββββββββββ΄ββββββββββββββββββββββ΄βββββββββββ΄βββββββββββββββββββββββββββββββββ
4. Compare Changesο
See what changed in the latest commit:
pt -d src/main.go --last
This shows a beautiful side-by-side diff using delta.
5. Rollback if Neededο
Restore the previous version:
pt -r src/main.go --last -m "Rolling back due to test failure"
Output:
β
Successfully restored: src/main.go
π¦ From backup: main_go.20251118_141124...
π Content size: 57046 characters
π¬ Restore comment: "Rolling back due to test failure"
Workflow Use Casesο
Daily Developmentο
# Morning: Check what changed yesterday
pt check
# Commit all work with descriptive message
pt commit -m "Day's work: feature X and bugfixes"
# Continue working...
# Before risky changes: backup specific file
pt main.go -m "Before refactoring auth module"
# After changes: review diff
pt -d main.go --last
# If tests fail: rollback
pt -r main.go --last -m "Reverting due to test failures"
Configuration Managementο
# Update config with context
pt config.json -m "Production DB settings for v2.1"
# Later update for testing
pt config.json -m "Testing new cache timeout"
# View all config versions
pt -l config.json
# Compare configs
pt -d config.json --last
# Restore production config
pt -r config.json --last -m "Reverting to production"
Emergency Rollbackο
# Check what files were recently modified
pt check
# View history of problematic file
pt -l script.sh
# Quick rollback
pt -r script.sh --last -m "Emergency rollback"
Workflow Advantagesο
Zero Setup - No repository initialization needed
File-Level - Works on individual files, not entire directories
Lightweight - No .git directory bloat, only .pt with actual backups
Flexible - Mix file-level backups with project-wide commits
Contextual - Every change has a comment explaining why
Safe - Automatic backups before destructive operations
Comparison with Gitο
Feature |
Git |
PT |
|---|---|---|
Setup |
git init required |
None needed |
Scope |
Entire repository |
Per-file + project |
Storage |
.git directory |
.pt directory |
Comments |
Commit messages |
Per-backup comments |
Learning Curve |
Steep |
Very simple |
Best For |
Code projects |
Files, configs, snippets, notes |
PT complements Git - use Git for code collaboration and PT for quick local version control of files, configurations, and snippets.