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)