DEV Community

Cover image for Git & GitHub Interview Cheatsheet: Commands + Workflow Tips ๐Ÿ”
Caner Yesiltas
Caner Yesiltas

Posted on โ€ข Edited on

Git & GitHub Interview Cheatsheet: Commands + Workflow Tips ๐Ÿ”

Why Git?

I use Git to track my code changes (like a time machine for code ๐Ÿ•ฐ๏ธ) especially in team projects. No internet? No problem work offline, push later. Plus, itโ€™s a lifesaver when I mess up and need to undo stuff.

Basic Commands:
git init: Turns a folder into a Git repo.
git clone [url]: Copies a repo from GitHub to your PC.
git add: Stages changes (like putting files in a "ready to save" box ๐Ÿ“ฆ).
git commit -m "message": Saves changes locally with a note (e.g., "fixed the login bug").
git push: Uploads your commits to GitHub.
git pull: Grabs the latest updates from GitHub.
git branch [name]: Creates a new branch (like a parallel universe for your code ๐ŸŒŒ).
git merge [branch]: Merges branches (carefulโ€”conflict resolution might get problem).

Branching Strategies

1๏ธโƒฃBranch off main โ†’ code โ†’ PR โ†’ merge.
Perfect for small projects or solo work. No drama, just deploy fast ๐Ÿš€.

2๏ธโƒฃGit Flow:
Ideal for complex apps with scheduled releases ๐Ÿ—“๏ธ
main = stable code.
develop = testing zone.
feature/[name] = where you build new stuff.
hotfix = emergency patches.

Wrap-Up & Pro Tips๐Ÿ”ฅ
Gitโ€™s power isnโ€™t just in commands itโ€™s how you use it to collaborate. For interviews, focus on WHY you chose a workflow (e.g., โ€˜We used GitHub Flow for speedโ€™). Practice resolving merge conflicts (trust me, theyโ€™ll ask!).

Your Action Plan โœ…
Clone a repo โ†’ Mess with code โ†’ Fix it with git revert.
Simulate a team project โ†’ Use branches + PRs (even solo!).
Memorize ONE story (e.g., โ€œI once broke production but fixed it with Gitโ€).

Drop a comment if youโ€™ve survived a Git horror story letโ€™s cry together ๐Ÿ˜‚. Good luck, future Git master!

Playwright CLI Flags Tutorial

5 Playwright CLI Flags That Will Transform Your Testing Workflow

  • 0:56 --last-failed
  • 2:34 --only-changed
  • 4:27 --repeat-each
  • 5:15 --forbid-only
  • 5:51 --ui --headed --workers 1

Learn how these powerful command-line options can save you time, strengthen your test suite, and streamline your Playwright testing experience. Click on any timestamp above to jump directly to that section in the tutorial!

Watch Full Video ๐Ÿ“น๏ธ

Top comments (0)

๐Ÿ‘‹ Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay