A distributed version control system that helps you track changes, collaborate without overwriting each other’s work, and recover from “oops” moments and make them "aha" moments.
Think of it as a timeline of every decision your codebase has ever made - the good, the bad, and the experimental.
Common commands:
Think of it as a timeline of every decision your codebase has ever made - the good, the bad, and the experimental.
Common commands:
- git clone <repo-url> – Makes a local copy of a remote repository. Basically, downloads the project (and all its history) onto your machine.
- git status – Tells you what’s changed since your last commit. Great for confirming if you’re in control or if chaos has already begun.
- git add . – Stages all modified files for commit. You’re telling Git, “These changes matter — track them.”
- git commit -m "message" – Saves a snapshot of your changes. The message is your future debugging diary — write something meaningful.
- git push – Sends your commits to a remote repository (like GitHub). The part where you finally share your brilliance — or your broken code.
- git pull – Fetches and merges the latest changes from the remote. Always do this before pushing, unless you enjoy merge conflicts.
- git log – Shows commit history. Great for tracing when that one bug was born.
What's the git command that you learnt the hard way?