| name | Checkpoint Commit |
| description | Create quick checkpoint commits to save work-in-progress without detailed commit messages. Use when you want to save current progress, create a restore point, checkpoint before risky changes, or snapshot code mid-task. |
Checkpoint Commit
What This Skill Does
Creates quick work-in-progress (WIP) checkpoint commits with auto-generated messages. Perfect for:
- Saving progress before risky operations
- Creating restore points mid-development
- Quick snapshots without crafting commit messages
- Preserving work before context switches
Quick Start
git add -A && git commit -m "checkpoint: WIP $(date +%Y-%m-%d_%H:%M:%S)"
Checkpoint Patterns
Pattern 1: Simple Timestamp Checkpoint
git add -A && git commit -m "checkpoint: $(date +%Y-%m-%d_%H:%M:%S)"
Pattern 2: Checkpoint with Context
git add -A && git commit -m "checkpoint: WIP on <feature-name>"
Pattern 3: Checkpoint Before Risky Change
git add -A && git commit -m "checkpoint: before <risky-operation>"
Pattern 4: Checkpoint with File Summary
git add -A && git commit -m "checkpoint: $(git diff --cached --stat | tail -1 | xargs)"
Step-by-Step Guide
Creating a Checkpoint
-
Stage all changes:
git add -A
-
Create checkpoint commit:
git commit -m "checkpoint: WIP $(date +%Y-%m-%d_%H:%M:%S)"
-
Verify checkpoint created:
git log --oneline -1
Restoring from Checkpoint
If you need to go back to a checkpoint:
git log --oneline --grep="checkpoint:" -10
git reset --soft <checkpoint-hash>
git reset --hard <checkpoint-hash>
Cleaning Up Checkpoints
Before pushing, squash checkpoint commits into meaningful commits:
git rebase -i HEAD~<number-of-commits>
Best Practices
When to Checkpoint
- Before refactoring code
- Before deleting files
- Before merge operations
- When switching tasks mid-work
- Before running automated fixes (linting, formatting)
- After completing a logical unit of work
Checkpoint Message Conventions
checkpoint: WIP # Generic work-in-progress
checkpoint: before refactor # Before risky operation
checkpoint: auth flow progress # With feature context
checkpoint: 2024-01-15_14:30:00 # Timestamp-based
Never Push Checkpoints
Checkpoints are local-only. Always squash or rewrite before pushing:
git log origin/main..HEAD --oneline --grep="checkpoint:"
git rebase -i origin/main
Troubleshooting
Issue: "Nothing to commit"
Cause: No changes since last commit
Solution: Only checkpoint when there are actual changes
git status --porcelain | grep -q . && git add -A && git commit -m "checkpoint: WIP"
Issue: Accidentally pushed checkpoints
Solution: If not shared, rewrite history:
git rebase -i origin/main~<n>
git push --force-with-lease
Issue: Too many checkpoints cluttering history
Solution: Squash before continuing work:
git reset --soft HEAD~<n>
git commit -m "feat: <proper-message>"
Advanced Usage
Checkpoint with Branch Backup
For extra safety, create a backup branch:
git branch backup/$(date +%Y%m%d_%H%M%S) && git add -A && git commit -m "checkpoint: WIP"
Auto-Checkpoint Hook (Optional)
Create a pre-commit alias for quick checkpoints:
[alias]
cp = "!git add -A && git commit -m \"checkpoint: WIP $(date +%Y-%m-%d_%H:%M:%S)\""
git cp
View Checkpoint History
git log --oneline --all --grep="checkpoint:"
git show <checkpoint-hash>
Related Commands
| Command | Purpose |
|---|
git stash | Temporary storage (not a commit) |
git commit --amend | Modify last commit |
git reset --soft | Undo commit, keep changes staged |
git reflog | View all HEAD changes (recovery) |