Alex, a bright-eyed new developer, was eager to dive into his first open-source project 🚀. The project’s code was hosted on a remote repository, and Alex’s first task was to get a local copy. He opened his terminal and typed:
git add . stages all changes in the current directory and everything below it — modified files, new files, and deleted files — in a single command. It’s the fastest way to prepare everything for a commit when you want the full working-directory state captured. This is the fourth post in this site’s Git command guide, following Git Add.
git push uploads your local commits to a remote repository, updating the remote’s branch to match yours. It’s the command that turns your local work into something your team — or your deploy pipeline — can actually see. This is the ninth post in this site’s Git command guide, following Git Checkout.
git pull fetches commits from a remote repository and merges them into your current local branch. It’s actually two commands in one — git fetch followed by a merge (or rebase, depending on configuration) — which is exactly why modern Git insists you tell it which reconciliation strategy you want. This is the tenth post in this site’s Git command guide, following Git Push.
git checkout switches between branches and updates the files in your working directory to match the version stored in a specific branch or commit. It’s one of Git’s oldest commands — and one of its most overloaded, which is exactly why newer Git split part of its job out into two other commands. This is the eighth post in this site’s Git command guide, following Git Branch.
git branch lists, creates, renames, and deletes branches in a Git repository. Branches are just lightweight, movable pointers to commits — creating one is nearly instant because it doesn’t copy any files. This is the seventh post in this site’s Git command guide, following Git Status.
git log displays the commit history of a repository — author, date, commit hash, and message, in reverse chronological order with the most recent commit first. It’s the command I reach for whenever I need to answer “who changed this and when,” and it has far more useful flags than the bare command suggests. This is the eleventh post in this site’s Git command guide, following Git Pull.