Overview Maintaining a clean commit history isn't just about vanity; it's about communication. When you open a pull request, your history tells a story to the reviewer. Git Interactive Rebase is the ultimate tool for refining that story. It allows you to rewrite history by combining, renaming, or deleting commits before they ever touch the main branch. This process transforms a messy series of "work in progress" (WIP) snapshots into a logical progression of features and fixes. Prerequisites To get the most out of this tutorial, you should be comfortable with basic Git operations like `git add`, `git commit`, and `git log`. Familiarity with terminal-based text editors—specifically Vim—is helpful, as rebase opens an interactive todo list in your default shell editor. You should also understand the concept of a HEAD pointer and how branches diverge from a common ancestor. Key Libraries & Tools * **Git**: The core distributed version control system used for all commands. * **Vim**: A terminal-based text editor often used as the default interface for rebase todo lists. * **Z**: A command-line tool mentioned by Rissa Jackson for quickly navigating between project directories. Code Walkthrough: Cleaning Your History The Interactive Command To start a rebase, you need to point Git to the commit *before* the ones you want to edit. Using the tilde (`~`) notation is the most reliable method. ```bash git rebase -i [commit-hash]~ ``` This opens an interactive list. Each line starts with the word `pick`. To change the history, you replace `pick` with a specific command. Dropping and Rewording If you have a commit that should never have existed, like a test file you accidentally committed, use the `drop` command. For simple typos in a commit message, use `reword`. ```text Interactive Rebase Todo List reword a1b2c3d Fix typo in post model drop e5f6g7h Delete me: temporary debugging pick i9j0k1l Add actual feature logic ``` Squashing and Fixing Up These are the workhorses of a clean history. Both `squash` and `fixup` meld a "child" commit into the "parent" commit above it. The difference lies in the message: `squash` prompts you to combine both messages, while `fixup` discards the child’s message entirely. ```bash Using fixup to hide a small cleanup pick a1b2c3d Main feature work fixup e5f6g7h Oops, forgot a semicolon ``` Syntax Notes You don't need to use the full 40-character SHA-1 hash. Git usually understands the first seven characters. In the rebase editor, simply changing the command word at the start of the line (e.g., from `pick` to `f` for fixup) is sufficient to trigger the change upon saving and exiting. Tips & Gotchas Rebasing is a destructive action because it generates new commit hashes. **Never rebase commits that have already been pushed to a shared branch** where others are working; you will break their history. If you must push rebased code to your own feature branch, use `git push --force-with-lease`. This "Canadian Force" command ensures you don't accidentally overwrite someone else's work if they added commits to the branch while you were rebasing locally. If things get confusing, your emergency exit is `git rebase --abort`.
Vim
Products
- Aug 19, 2025
- Sep 4, 2024
- Dec 23, 2022
- Apr 29, 2022
- Dec 31, 2021
The Quiet Gravity of Doing Nothing When we stand at life's crossroads, we usually obsess over the mechanics of the pivot. We weigh Option A against Option B, agonizing over which path offers the most growth or the least risk. However, Derek Sivers suggests we often ignore the most powerful choice on the table: Option C—the decision to do nothing at all. This isn't about laziness; it is about explicitly naming the benefit of your current trajectory. If you are staying in a job you dislike or a city that feels stagnant, there is a subconscious reward keeping you there. Perhaps it is the comfort of being an expert, the safety of a predictable routine, or the avoidance of feeling like a beginner again. Naming these hidden benefits brings them out of the subconscious and onto the table where they can be weighed. We must admit that it is okay to remain still. In a culture that demands constant "pivoting" and "hustle," the act of waiting for the right moment is a radical form of excellence. Charlie Munger once proposed a thought experiment for young investors: imagine a loyalty card with only ten slots. Those are the only ten investments you get for your entire life. If you knew your slots were limited, you wouldn't jump at every shiny object. You would wait years for the one opportunity you could knock out of the park. This patience is not stagnation; it is a calculated gathering of energy for the one 'hell yeah' that actually matters. The Fallacy of the Succinct Truth We live in an era of the aphorism. We scroll through social media and see Seneca or Marcus Aurelius distilled into a single sentence, sandwiched between dog videos and fitness influencers. While Derek Sivers writes in lean, twenty-two-sentence chapters, he warns that we must not mistake succinctness for truth. Slogans and quips are excellent tools for spreading ideas—like dandelions catching the wind—but truth itself is almost always messy and nuanced. Nuance is the space where the "either/or" binary dissolves. We often force ourselves into identities that don't fit the complexity of human experience. You might think, "I am a city person," only to find yourself craving the woods after three months of sirens. The truth is not that you were wrong about yourself, but that your needs are conditional. You might be a city person in the winter of your life and a country person in its spring. By clinging to a simple self-identity for the sake of a social media bio, we lobotomize our own potential for change. Excellence requires the precision to acknowledge that what was true for you five years ago—or even five minutes ago—may no longer apply. Designing for the Century, Not the Scroll Modern life is built on frameworks of planned obsolescence. We build our businesses on Amazon or Facebook, effectively renting our audience from corporate middlemen who could change the rules or vanish tomorrow. To counteract this, Sivers advocates for a "low-tech" longevity. He writes his own code in Vim, avoids the cloud, and builds websites in plain HTML. This isn't just a technical preference; it is a philosophical stance against the ephemeral. By stripping away the "JavaScript junk" and contemporary tooling, he is building a digital legacy intended to last a hundred years. This mindset shifts the stakes of creation. When you realize that your words might be read by a civilization on Saturn's moons, you stop writing for the algorithm and start writing for the soul. It makes every sentence feel like it's worth cutting down a tree for. This level of intentionality creates a different kind of product—one that feels hand-crafted and permanent in a world of disposable content. The Paradox of Digital Presence There is a visceral relief in being unreachable. Sivers practices a form of digital hygiene that many would find impossible: powering down the broadband modem and the phone two hours before sleep and keeping them off for the first four hours of the morning. This creates a sanctuary where the brain can engage in deep work without the background radiation of alerts and notifications. We often use the "treadmill" as a negative metaphor for work, yet we keep ourselves on the digital treadmill voluntarily. If you don't keep cookies in the house, you can't eat them; if you don't have the internet as an option, your brain stops seeking the hit of Reddit or YouTube. This physical boundary allows for a different quality of thought. It moves the needle from "shallow happy"—the quick hit of a like or a comment—to "deep happy," which is the pride of having faced a difficult task and seen it through to completion. Meaning as a Moving Target We often obsess over the "meaning of life" as a way to soothe our fear of mortality. We want a grand narrative that justifies our existence before the lights go out. But perhaps meaning is much smaller and more immediate than we think. Meaning can simply be the project you are working on this hour, the book that tickles your brain this decade, or the child you are raising in nature. Derren Brown suggests in his book Happy that our thought patterns *are* our personality. When we share those thoughts, our personality continues to live in the minds of others long after we are gone. In this sense, a musician like David Bowie isn't dead to the person listening to his 1972 record for the first time. The creative output is a form of eternal life. If you enjoy the process of making, the fact that no one may remember your name in fifty years becomes irrelevant. The joy was in the doing, not the legacy. Growth is a series of intentional, often difficult steps taken away from the easy path and toward the nuanced, colorful reality of who we are becoming.
Mar 12, 2020