<aside> 💡

Vibhor Sharma - Nov 24th 2025

</aside>

through various work experiences and side projects, i've picked up a lot of git commands that have saved my life more than once. i wanted to create a central place to store all these commands for easy reference.

mental model

git is a distributed version control system (local). github is a hosting platform (online). most of us memorize commands without understanding the graph model underneath.

core concepts

snapshots, not diffs

git stores a full snapshot of your project with every commit, not just the differences. if a file hasn't changed, it stores a pointer to the previous version.

the three trees

setup & config

git config --global user.name "name"

set your username for commits.

git config --global user.email "email"

set your email for commits.

git config --global color.ui auto

enable helpful color output.

git config --list

show all configuration settings.