git add is the command that stages changes from your working directory into Git’s index, marking them to be included in the next commit. Staging is an intermediate step that gives you precise control — you can add one file at a time, leaving other modified files unstaged until a later commit. This is the third post in this site’s Git command guide, following Git Clone.
Tag Archives: Git
Git Commit
git commit saves your staged changes to the local repository as a permanent snapshot. It creates a new commit object with a unique identifier based on the changes made, along with a message that describes them. This is the fifth post in this site’s Git command guide, following Git Add . (All).
Git Status
git status shows you the current state of your working directory and staging area — which files are tracked, which have been modified, which are staged for the next commit, and which Git doesn’t know about at all. It’s the command I run more than any other Git command, usually right before deciding what to do next. This is the sixth post in this site’s Git command guide, following Git Commit.
Git Push
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 Init
git init is the command that turns an ordinary folder into a Git repository. It creates a hidden .git subdirectory containing the object database, refs, and config that Git needs to start tracking history. You only run it once per project — after that, every git add and git commit writes into that same .git directory. This is the first post in this site’s Git command guide, so if you’re setting up a brand-new project, this is where you start.
Git: Delete Last Commit
Everyone who’s used Git for long enough has committed something they didn’t mean to — a debug print left in, a config file with the wrong values, a commit message that’s just “wip.” The fix depends entirely on one question: has that commit been pushed anywhere yet? This post walks through both cases. It’s the twelfth post in this site’s Git command guide, following Git Log.
Continue reading Git: Delete Last CommitGit – Autocorrect Spelling
Git has a built-in typo handler that most people never turn on: help.autocorrect. By default Git just suggests the command it thinks you meant, but you can configure it to run the correction automatically, with or without a delay. This is the thirteenth and last post in this site’s Git command guide — a smaller, more personal config topic to close out with, following Git: Delete Last Commit.