Back to KB
Difficulty
Intermediate
Read Time
4 min

The git Commands You Forgot Exist (And Why AI Workflows Make Them Relevant Again)

By Codcompass TeamΒ·Β·4 min read

Most devs know git commit, git push, git stash. Then there's a whole floor below that nobody visits.

Try it yourself: clone git-archaeology-lab, run bash setup.sh, and every command in this article has a working exercise waiting for you.


git worktree β€” multiple checkouts, one repo

This one is criminally underused. By default, git lets you have exactly one working directory per clone. git worktree breaks that constraint.

You now have two fully independent working directories β€” same repo, different branches β€” with no stashing, no switching, no context loss.

Why it's back: AI coding agents. When you're running Claude Code or Cursor on one branch and need to review a hotfix on another, switching branches mid-session breaks everything. git worktree lets both live simultaneously. Each agent gets its own tree. No collisions.


git bisect β€” binary search your blame

You have a bug. You know it didn't exist three weeks ago. You have 200 commits in between. git bisect turns that into about 8 tries.

The real power is git bisect run β€” pass any command that exits 0 (good) or non-zero (bad). Your whole test suite, a curl health check, a grep β€” anything that detects the regression works as the oracle. git drives itself to the culpable commit with zero manual steps.


git rerere β€” never resolve the same conflict twice

`re

πŸŽ‰ Mid-Year Sale β€” Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register β€” Start Free Trial

7-day free trial Β· Cancel anytime Β· 30-day money-back