A small Git workflow for infrastructure changes
Make configuration changes reviewable and easier to roll back.
Start with the current state
Use version control for configuration templates and scripts, never for credentials. Before editing, inspect the working tree so that unrelated work is not accidentally included.
git status --short
git switch -c change/document-service-checksKeep the change focused
Include the reason for the change, its expected behavior, how to validate it, and the rollback plan. Review the actual diff rather than relying only on the files you remember editing.
git diff --check
git diff
# Stage specific paths after reviewing them
git add README.md
git diff --cachedSeparate merging from rollout
A reviewed commit is not proof that production is healthy. Deploy through the team’s approved pipeline, check the resulting application behavior, and monitor for regressions. Some Git integrations deploy automatically when main changes; account for that before merging.
Plan the rollback
For a shared branch, prefer a reviewed revert to rewriting history. Configuration rollback may not reverse data migrations or external side effects. Record those limitations before the change, and verify recovery after any rollback.