- Published on
Git Commands You (and I) Should Replace
Git is a powerful tool, but some commands have newer, more precise alternatives that improve workflow. Here’s why you should consider updating these commands:
git checkout → git switch
git switch
focuses solely on switching branches, unlike git checkout
, which is more ambiguous.
git stash → git worktree
With git worktree
, you can work on multiple branches at once without stashing changes.
git reset → git restore
git restore
is safer as it targets specific files without affecting commit history.
git status → git status -sb
A shorter, more informative output, including branch status.
git pull → git pull --rebase
Rebase avoids messy merge commits, keeping the history linear.
For further details, check the official Git documentation.
Last updated