AI Hints
Home›Git & GitHub Tutorial›Interview Questions 2
Git & GitHub · Lesson 136 of 144

Interview Questions: Teamwork

Workflows and good habits.

⏱ 2 min read▶ Video at 2:28:42🎓 Free
Watch this lesson in the Git & GitHub courseWatch on YouTube ↗Full Git & GitHub course

The last group of questions is about how you work with others. There's no single right answer here. Interviewers want to hear that you think about your teammates.

Interview Questions: Teamwork
From the video: Interview Questions: Teamwork
  • How you work with others
  • No single right answer
  • Show you think about teammates

Describe your workflow

Question ten. Describe your Git workflow. A great answer walks through GitHub flow. Pull the latest main. Create a feature branch. Make small commits with clear messages. Push, and open a pull request. Respond to review. Merge, and delete the branch.

  1. Pull mainstart fresh
  2. Branchone per task
  3. Commit & pushsmall, clear
  4. PR & mergeafter review
Describe your workflow
From the video: Describe your workflow

What makes a good commit?

Question eleven. What makes a good commit? It does one thing. It has a short, clear message, starting with a verb, explaining what and why. It doesn't break the build. And it never contains secrets, or generated files.

One thingfocused
Clear messagewhat and why
Worksdoesn't break things
Cleanno secrets or junk

Have you ever force pushed?

Question twelve. When is it okay to force push? Only to your own branch, that nobody else is using, for example after a rebase. Prefer force with lease, which refuses if someone else pushed in the meantime. And never force push a shared branch like main.

Own branchafter a rebase
--force-with-leasesafer
Shared branchnever
mainprotect it

Summary

Describe GitHub flow, explain good commits, and show you'd never force push shared work. You're ready for most Git interviews. Next, a few trickier questions that catch people out.

Key takeaways
  • GitHub flow
  • Good commits
  • Force push with care
Next up: Interview Questions: Tricky Ones — the ones that catch people out