// Dictionary

The Fucking Git Dictionary

Git commands, translated into what they really mean.

CommandTranslation
git initThe beginning of all your problems.Creates a new Git repository in the current folder.
git cloneAdopt someone else's problems.Downloads a repository and its whole history.
git statusAsk Git how bad it is.Shows changed, staged and untracked files.
git add .Everything. Even what you shouldn't.Stages every change in the current folder for the next commit.
git pushSend your work out into the world.Uploads your local commits to the remote branch.
git push --forceGamble with your career.Replaces the remote branch with yours, whatever is on it.
git reset --hardMake your problems disappear. And your work.Moves the branch and overwrites the working directory.
git stashSweep your problems under the rug.Saves uncommitted changes aside and cleans the working directory.
git reflogYour last hope.Journal of every position HEAD went through.
git cherry-pickSteal a commit with elegance.Applies the changes of a given commit on the current branch.
git blameFind someone to blame. Find yourself.Shows who last modified each line of a file.
git commit -m "fix"Lie to your future self.Records staged changes with a (very unhelpful) message.
git rebase -iRewrite history like a dictator.Reorder, squash, edit or drop commits interactively.
git mergeMarry two branches. Expect arguments.Joins the history of another branch into the current one.
git bisectDetective mode: find the guilty commit.Binary search through history to find the commit that introduced a bug.
git clean -fdMarie Kondo, but irreversible.Deletes all untracked files and folders.
git pullOpen the box of surprises your colleagues left you.Fetches remote changes and merges them into your branch.
git checkout .Ctrl+Z on your entire afternoon.Discards every uncommitted change in the current folder.
git commit --amendPretend it never happened.Replaces the last commit with a new one.
git logRead the diary of your mistakes.Lists the commit history.
git fetchLook at the disaster without touching it.Downloads remote commits without changing your branches or files.
git diffSpot the 7 differences. There are 412.Shows line-by-line changes not yet staged.
git revertApologise publicly, in writing.Creates a new commit that undoes an old one, without rewriting history.
git switchChange worlds. Hopefully with your work saved.Moves to another branch (the modern half of git checkout).
git restoreCtrl+Z, but for one file.Restores files in the working directory or the index (the other half of git checkout).
git tagCarve a date on the tree. Never move it.Gives a permanent name to a commit, usually a version number.
git remoteThe list of places where your mistakes get published.Manages the remote repositories (origin, upstream…).
git configTell Git who to blame.Reads and writes settings: identity, aliases, behaviour.
git worktreeBe in two places at once. Legally.Checks out another branch in a second folder of the same repository.
git submoduleA repository inside a repository. Inception.Includes another repository at a fixed commit.
git rm --cachedPretend you never met.Stops tracking a file but keeps it on disk.
git gcTake out the trash. Including what you wanted to recover.Compresses the repository and removes unreachable objects after a delay.
git rerereDéjà vu, but useful.Remembers how you resolved a conflict and replays the resolution.
git lfsA storage room for your oversized files.Stores big files outside the repository, with pointers inside.
git switch -Undo my last life choice.Goes back to the branch you were on before.
git restore --stagedActually, not that one.Removes a file from the index; the changes stay on disk.
git stash popBring back what I hid, and hope.Applies the latest stash and deletes it (kept if there is a conflict).
git reset --soft HEAD~1I didn't mean to commit. Yet.Undoes the last commit and keeps its changes staged.
git branch -DDelete it. I said DELETE IT.Deletes a local branch even if its work isn't merged anywhere.
git push --force-with-leaseForce, but politely.Force push that refuses to overwrite commits you haven't seen.
git commit --fixupA patch for my patch.Creates a commit marked to be merged into another one by rebase --autosquash.
git merge --abortPretend this merge never happened.Stops a merge with conflicts and goes back to the state before it.
git rebase --abortCtrl+Z for a rebase.Cancels a rebase in progress and restores the branch as it was.
git log --onelineThe history, in tweet format.One line per commit: short hash and message.
git shortlog -snThe leaderboard.Number of commits per author.
git fsckGit's medical check-up.Checks the object database and lists lost commits.
git sparse-checkoutI only want my corner of the monorepo.Checks out only the folders you choose.
git describeWhich version am I, really?Names a commit from the nearest tag (v1.2.0-3-gabc123).
git archiveZip it, without the .git.Creates a zip/tar of a commit's files, without the history.
gh pr createPlease accept my code. I'm begging.Opens a pull request from the current branch (GitHub CLI).
gh pr checkoutLet me see your mess up close.Downloads a pull request's branch and switches to it.
gh pr merge --squash47 commits enter, 1 comes out.Merges the PR as a single commit on the base branch.
git request-pullA pull request, the 2005 way.Generates a text summary asking someone to pull your branch (the email ancestor of PRs).
git range-diffSpot the difference, rebase edition.Compares two versions of a series of commits, e.g. a PR before and after a force push.
git merge --squashHide the drafts, keep the result.Brings a branch's changes as one uncommitted change, to commit as a single commit.