57 / 57 · 17 Git & Version Control · Gitignore and Practical Tips← prev⊞ all☰ Read as one page
7.9Hands-On Exercise
- Review your project's
.gitignore. Are test results, screenshots, and.envfiles properly ignored? - Check if any test artifacts have been accidentally committed:
git ls-files | grep -E "(test-results|coverage|screenshots)" - Set up the Git aliases listed above and use
git lgto explore your project's history - Practice
git stashto switch branches mid-work and return without losing changes - Use
git log -Sto find when a specific test selector was introduced or changed - Set up a pre-commit hook that prevents committing
.onlyin test files
Interview Talking Point: "I use Git as a QA tool, not just a code storage tool. I use git bisect to binary-search for regression-introducing commits, saving hours of manual investigation. I write PR descriptions that include test evidence and verification steps. I understand branching strategies well enough to adapt my test execution plan -- in trunk-based development I ensure every commit is deployable, while in GitFlow I plan for testing at multiple integration points. I configure .gitignore to keep test artifacts out of the repository, and I use git hooks to prevent common mistakes like committing .only or .env files. I tag releases with test result metadata so we have a clear audit trail of what was verified for each release."