Git & GitHub Best Practices
These are the habits that keep an AWS SDK repository safe and reviewable by default, not just fast to commit to.
Busca en todas las páginas de la documentación
These are the habits that keep an AWS SDK repository safe and reviewable by default, not just fast to commit to.
Walk the list once now, then treat it as a review checklist before opening or approving any PR that touches AWS-facing code.
.env files. Add them to .gitignore before the first commit, since untracking a file after the fact does not remove it from history.__pycache__/, node_modules/, and build output are regenerated, not authored, and only bloat the repo..tfstate can contain resource attributes and sometimes secrets; keep state in a remote backend, not Git.Let .gitignore do this work automatically, before you ever run git add.
cat > .gitignore <<'EOF'
.env
*.tfstate
*.tfstate.backup
__pycache__/
node_modules/
.aws-sam/
EOFAKIAIOSFODNN7EXAMPLE rather than disabling scanning entirely.main close to what's actually deployed.fix/, feature/, chore/ prefixes make a PR's purpose clear before anyone opens the diff.main in periodically on longer-lived work. This keeps conflicts small and frequent instead of one large one at the end.main with required reviews and status checks. No one, including admins, should be able to push directly to it.iam/, infra/, and cloudformation/ routes the riskiest changes to someone who owns that risk.Action or Resource wildcards automatically, before a human review even starts.git diff --staged catches a stray print statement or an accidental credential before it's ever recorded.git blame and git log stay useful for the next person debugging an issue.Never committing credentials in the first place. Everything else - scanning, protected branches, rotation - exists to catch or contain the cases where that first line of defense fails.
No. It only runs on machines where it's installed, so pair it with GitHub secret scanning/push protection and a CI scan so a bypassed or missing local hook isn't the only defense.
Terraform state files can include resource attributes and occasionally secrets in plaintext, and they're meant to live in a remote backend with locking, not in Git history.
No. Route the mandatory extra reviewer only at infra-touching paths via CODEOWNERS; application-only PRs should merge under the general review requirement without added friction.
Not by itself. Rotate (deactivate) the key in IAM first - that's what actually closes the exposure. History cleanup afterward is good hygiene but doesn't undo a leak already scraped.
Small, single-purpose PRs review faster and revert cleanly. A PR that mixes a refactor with an infra change makes both harder to review and harder to safely undo if something's wrong.
No - it costs nothing to configure and it preserves the review history, which matters the moment you need to reconstruct exactly what changed and when, regardless of team size.
The reason for the change, not just a restatement of the diff. "Fix retry backoff for throttled DynamoDB writes" is far more useful later than "fix bug" or "update code".
Stack versions: This page was written for boto3 1.43.x (Python 3.10+) and the AWS SDK for JavaScript v3 (Node.js 18+).
Revisado por Chris St. John·Última actualización: 23 jul 2026