DEV Community

Manu Kumar Pal
Manu Kumar Pal

Posted on

πŸ’» 5 Git Commands Every Full Stack Developer Should Know

Hey community! πŸ‘‹ As full stack devs, we juggle front-end, back-end, APIs, and more. Git keeps us on track, but it’s more than just commit and push.

Here are 5 powerful Git commands to boost your workflow and save your code when it matters most. Let’s go! πŸš€.

βœ… 1. 🧭 Git Reflog β€” Your Safety Net

What it is:

Git Reflog tracks every change of your HEAD β€” even commits you thought were lost after resets or rebases.

Why it matters:

Deleted work by accident? Reflog lets you recover it.

Try it:

git reflog
git checkout HEAD@{2}
Enter fullscreen mode Exit fullscreen mode

βœ… 2. πŸ•΅οΈβ€β™‚οΈ Git Bisect β€” Debug Like a Pro

What it is:

A binary search tool to pinpoint the exact commit that introduced a bug.

Why it matters:

No more manual guesswork through dozens of commits.

Try it:

git bisect start
git bisect bad
git bisect good <commit_hash>
# Keep testing commits, marking good or bad
git bisect good
git bisect bad
Enter fullscreen mode Exit fullscreen mode

βœ… 3. 🧹 Git Clean β€” Keep Your Repo Tidy

What it is:

Removes untracked files and directories from your working directory.

Why it matters:

Clean up build artifacts, temp files, or experiment leftovers fast.

Try it:

git clean -fd
Enter fullscreen mode Exit fullscreen mode

Tip: Use git clean -nfd first for a dry run.

βœ… 4. πŸ“ Git Notes β€” Add Context Without History Changes

What it is:

Attach notes to commits without rewriting history.

Why it matters:

Great for review comments, extra info, or reminders.

Try it:

git notes add -m "Reviewed and approved by QA"
git log --show-notes
Enter fullscreen mode Exit fullscreen mode

βœ… 5. 🧰 Git Worktree β€” Multiple Branches, One Repo

What it is:

Check out multiple branches at once in different folders β€” no need for multiple clones.

Why it matters:

Work on a hotfix and a feature at the same time, hassle-free.

Try it:

git worktree add ../feature-branch feature-branch
Enter fullscreen mode Exit fullscreen mode

πŸš€ Wrap Up: Boost Your Git Skills

Use these commands to save time, avoid mistakes, and work smarter on your full stack projects. Git is more powerful than you thinkβ€”start mastering it today!

Got a favorite Git trick? Drop it below! πŸ‘‡

Top comments (0)