Master Git — It's Easier Than You Think!
Every time I interview someone, I’m surprised when a developer doesn’t know Git.
You don’t need to be an expert, but every developer should know the basics.
git initInitialize a new repository.
git clone https://github.com/user/repo.gitClone a remote repository.
git statusCheck the current status of files.
git add .Add all changes to the staging area.
git commit -m "Message"Commit changes with a message.
git logView commit history.
git diffSee differences between the working directory and the index.
git checkout branch-nameSwitch to another branch.
git branchList all local branches.
git branch branch-nameCreate a new branch.
git merge branch-nameMerge a branch into the current one.
git pullFetch and merge changes from the remote repository.
git pushPush changes to the remote repository.
git stashStash current changes without committing.
git reset --hardReset the working directory to the last commit (caution!).
git rebase branch-nameMove current branch changes on top of another branch.
Example: git rebase main brings your branch up to date with main.
git rebase -i HEAD~3Interactive rebase of the last 3 commits, for example to squash.
# In interactive rebase
pick a1b2c3 First commit
squash d4e5f6 Second commit (will be combined)Squash: combine multiple commits into one.
git revert <hash>Create a new commit that reverts the specified one (without erasing history).
Want to remember it better? Host a mini-meetup:
📌 Even in a team of just 3 — this helps everyone grow.
Want to practice Git hands-on?
Here’s a fantastic interactive tool:
branch, merge, and rebase work.📌 Complete the first 3–4 levels — Git will finally make sense.
If you’re still confused by add, commit, and pull,
today is the perfect day to master them.
git status.Good luck! And may merge conflicts only appear on holidays 😄