- Stash-like tracking: Instead of using git stash, use a sequence of temporary commits on a detached HEAD.
- Detached HEAD commits: Each incremental automation change is committed but does not affect the working branch.
- Reflog for tracking: Each commit is reachable via git reflog, so you can review each change step by step.
- No changes left behind: Once the tool completes execution, the working directory still contains uncommitted changes.
Before making changes:
git checkout --detach
Each time an automation step modifies files, create a commit:
git add .
git commit -m "Automation Step N"
This creates a history of changes without affecting the main branch.
Each commit has a git reference, which you can extract using:
git reflog
This allows a reviewer to check the changes step by step.
git checkout - # Switch back to the previous branch
git reset HEAD # Keep working directory changes, remove commit history
This ensures that: The branch stays untouched. The working directory still contains uncommitted changes.
At the end of the process, print commit refs for your review:
git reflog --oneline