Ravindra BagaleCourses & study guides

Chapter 17: Interview Questions and Job Readiness

17.2 Git and GitHub

Q6. What does git status tell you before git add?

Which files are modified/untracked. Always check before git add . so secrets and build junk are not staged.

Q7. What belongs in .gitignore for DevOps labs?

.env, keys/PEM files, node_modules, Terraform state, personal *.tfvars, IDE junk — keep example.env with fake placeholders.

Q8. Feature branch workflow?

Branch from main → commit → push → open PR → review/CI → merge. Avoid committing straight to protected main.

Q9. How do you resolve a merge conflict?

Open conflicted files, choose correct code between markers, test, commit the merge. Communicate if business logic is unclear.

Q10. What is a good commit message?

Imperative, specific: "Add /health endpoint for badge API API" — not "fix" or "final final."

Q11. When is git commit --amend unsafe?

After you have already pushed the commit to a shared branch — rewriting history confuses teammates unless the team explicitly allows force-with-lease workflows.

Q12. What is a pull request good for?

Human review, CI gates, discussion, and an audit trail of why a change landed.