Menu

Git commands I use daily (cheatsheet)
📰

Git commands I use daily (cheatsheet)

DEV Community·sohana khan·7 months ago
#GK547t1T
#git#productivity#beginners#cheatsheet#bash
Reading 0:00
15s threshold

Most Git tutorials throw an encyclopedia at you. But in reality, you’ll use the same ~10 commands every single day.

Here’s my no-fluff daily cheatsheet.

The absolute basics bash git clone # Download a repo git status # What changed? git add . # Stage everything git commit -m "fix: message" # Save changes

Working with remotes bash git pull --rebase # Get latest changes (cleaner history) git push # Upload your commits git fetch # See what changed without merging

Branching (daily) bash git branch # List branches (* = current) git checkout -b feat/x # Create + switch to new branch git switch main # Switch to main (newer syntax) git branch -d old-branch # Delete local branch

Fixing mistakes (no panic) bash git commit --amend -m "new message" # Edit last commit git reset HEAD~1 # Undo last commit (keep changes) git restore file.js # Discard unstaged changes git restore --staged .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.