---
title: "TIL: git history fixup replaces the autosquash dance"
description: Git 2.55's experimental git history fixup folds staged changes into an earlier commit in one command. I built it from source and ran it.
canonical: https://lukeocodes.dev/git-history-fixup
type: article
locale: en_GB
published: 2026-07-28T00:00:00.000Z
modified: 2026-07-28T00:00:00.000Z
authors:
  - Luke Oliff
section: TIL
tags:
  - TIL
  - Git
  - Engineering
feed: https://lukeocodes.dev/rss.xml
search: https://lukeocodes.dev/search.json?q={query}
schema:
  - "@context": https://schema.org
    "@graph":
      - "@type": WebSite
        "@id": https://lukeocodes.dev/#website
        url: https://lukeocodes.dev
        name: Luke Oliff
        alternateName: lukeocodes
        inLanguage: en
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
        description: Personal blog and writing by Luke Oliff — developer relations, voice AI, developer experience.
        potentialAction:
          - "@type": SearchAction
            target:
              "@type": EntryPoint
              urlTemplate: https://lukeocodes.dev/blog/search?q={search_term_string}
            query-input: required name=search_term_string
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Engineer and developer relations leader. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Engineer and developer relations leader
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
  - "@context": https://schema.org
    "@graph":
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Engineer and developer relations leader. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Engineer and developer relations leader
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
      - "@type": BlogPosting
        "@id": https://lukeocodes.dev/git-history-fixup#article
        headline: "TIL: git history fixup replaces the autosquash dance"
        alternativeHeadline: "TIL: git history fixup replaces the autosquash dance"
        description: Git 2.55's experimental git history fixup folds staged changes into an earlier commit in one command. I built it from source and ran it.
        datePublished: 2026-07-28T00:00:00.000Z
        dateModified: 2026-07-28T00:00:00.000Z
        url: https://lukeocodes.dev/git-history-fixup
        mainEntityOfPage: https://lukeocodes.dev/git-history-fixup
        inLanguage: en
        author:
          - "@id": https://lukeocodes.dev/authors/luke#person
        isPartOf:
          "@id": https://lukeocodes.dev/#website
        keywords: TIL, Git, Engineering
        articleSection: TIL
        abstract: Git 2.55 shipped an experimental subcommand, git history fixup <commit>, that takes whatever you have staged and folds it into an earlier commit, then replays everything after it. One command. It replaces the git commit --fixup plus git rebase --autosquash two-step I have been typing on autopilot for about a decade.
        speakable:
          "@type": SpeakableSpecification
          cssSelector:
            - .post-tldr
            - h1
        image: https://lukeocodes.dev/og.png?h=TIL%3A+git+history+fixup+replaces+the+autosquash+dance&d=Git+2.55%27s+experimental+git+history+fixup+folds+staged+changes+into+an+earlier+commit+in+one+command.+I+built+it+from+source+and+ran+it.&e=Writing
        wordCount: 922
        timeRequired: PT5M
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
      - "@type": BreadcrumbList
        itemListElement:
          - "@type": ListItem
            position: 1
            name: Home
            item: https://lukeocodes.dev
          - "@type": ListItem
            position: 2
            name: Writing
            item: https://lukeocodes.dev/blog
          - "@type": ListItem
            position: 3
            name: "TIL: git history fixup replaces the autosquash dance"
            item: https://lukeocodes.dev/git-history-fixup
---

[Luke Oliff.](/)

- [Blog](/blog)
- [CV](/cv)
- [Uses](/uses)
- [User manual](/user-manual)
- [Living with ADHD](/living-and-working-with-adhd)
- [RSS](/rss.xml)

[Luke Oliff · Writing](/blog)

# TIL: git history fixup replaces the autosquash dance

Jul 2026 · [TIL](/blog/category/til) · 5 min read · [Luke Oliff](/authors/luke)

Git 2.55 shipped an experimental subcommand, `git history fixup <commit>`, that takes whatever you have staged and folds it into an earlier commit, then replays everything after it. One command. It replaces the `git commit --fixup` plus `git rebase --autosquash` two-step I have been typing on autopilot for about a decade. TIL, and I ran it to check it does what the [release notes](https://github.blog/open-source/git/highlights-from-git-2-55/) claim.

The setup pain first: Ubuntu 24.04's apt ships git 2.43, and even the git-core PPA is only on 2.54 as I write this. `git history` landed in 2.54 but the `fixup` subcommand is new in 2.55, so I built it from source. One wrinkle worth knowing: 2.55 includes Rust components by default, so either have `cargo` on the box or build with `make NO_RUST=1`.

### What does git history fixup actually do?

You know the moment. You're polishing a branch, you spot a change in your working tree that belongs three commits back, and you sigh because now it's fixup-commit-then-autosquash time. The new way: stage the change, name the commit it belongs to, done.

Real repo, three commits, and the root commit is a pancake recipe missing its maple syrup (borrowed from the release post's example, because it's a good one):

```bash
$ git log --oneline
1c27b69 (HEAD -> main) add serving size
607de8b add method
85873a0 add pancake recipe

$ printf -- '- maple syrup\n' >> pancakes.md
$ git add pancakes.md
$ git history fixup 85873a0
```

That's it. No editor, no todo list, no `--autosquash`. The log after:

```bash
$ git log --oneline
3a459f9 (HEAD -> main) add serving size
0e42f1e add method
3f4de5e add pancake recipe

$ git show 3f4de5e:pancakes.md
# pancakes
- 100g flour
- 2 eggs
- 300ml milk
- maple syrup
```

The syrup is in the root commit as if it had always been there. Message and authorship stay as they were (pass `--reedit-message` if you want the editor). Every descendant hash changes, obviously, because that's how content addressing works. This is history rewriting, same rules as always: fine on your branch, rude on shared ones.

There's a `--dry-run` that prints the ref update it would make without touching anything, which I'll be using out of habit:

```bash
$ git history fixup 85873a0 --dry-run
update refs/heads/main 3a459f9668... 1c27b69d29...
```

And the reflog records it as its own operation, so `git reset HEAD@{1}` gets you back if you regret it:

```bash
$ git reflog -2
3a459f9 HEAD@{0}: fixup: updating 85873a0
1c27b69 HEAD@{1}: commit: add serving size
```

### What happens when the fixup would conflict?

It refuses to start. I staged a change to a line that a later commit had also touched:

```bash
$ git history fixup HEAD~1
error: fixup would produce conflicts; aborting
```

Exit code 255, branch untouched, staged changes still staged. This is the design choice I like most. `git rebase --autosquash` will happily drop you into a half-finished rebase with conflict markers and a detached HEAD, and now your quick fixup is a ten-minute cleanup. `git history fixup` is all-or-nothing. If it can't do the thing cleanly, it does nothing. For the 95% case (typo fixes, forgotten files, review feedback that belongs in an earlier commit of the series) that trade is exactly right, and for the other 5% the old rebase dance still exists.

Two more guardrails I hit while poking at it: it errors with `nothing to fixup: no staged changes` on a clean index rather than guessing at your working tree, and it needs a working tree at all, so no bare repos.

`git history` in 2.55 also has `reword` (edit an earlier commit's message without a rebase) and `split` (break a commit up by pathspec). Same shape: name the intent, not the mechanism. The [git history docs](https://git-scm.com/docs/git-history/2.55.0) mark the whole command experimental, so flags may shift before it stabilises. I'm using it anyway. It's been ten years since I set up [my default branch rename](https://lukeocodes.dev/change-git-s-default-branch-from-master) muscle memory; this one is going in next to it.

### FAQ

#### What version of Git has git history fixup?

Git 2.55.0, released in late June 2026. The parent `git history` command arrived experimental in 2.54, and 2.55 added the `fixup` subcommand alongside `reword` and `split`. Most distro packages lag: Ubuntu 24.04 apt has 2.43 and the git-core PPA had 2.54 when I checked, so you may need to build from source (with `cargo` available, or `make NO_RUST=1`).

#### Is git history fixup the same as git commit --fixup?

No. `git commit --fixup=<commit>` creates a marker commit you still have to squash later with `git rebase --autosquash`. `git history fixup <commit>` applies your staged changes to the target commit directly and replays the descendants in one step, with no interactive rebase, no editor, and no intermediate commit to clean up.

#### Is it safe to use an experimental Git command?

Reasonably, for this one. It aborts before touching anything if the result would conflict, records the operation in the reflog so you can undo with `git reset HEAD@{1}`, and refuses to run without staged changes. The experimental label means the interface may change between releases, not that it eats data. Keep it off shared branches, same as any history rewrite.

#### Does git history fixup work with unstaged changes?

No. It reads from the index only, and errors with `nothing to fixup: no staged changes` if you haven't staged anything. That's a feature: you choose exactly what gets folded into the earlier commit with `git add -p`, and anything unstaged stays in your working tree untouched.

[← Newer: Fish Audio's $52M Seed: Open Weights Got Them Here](/fish-audio-52m-seed-s21-pro)

[All posts](/blog) →

## Search this site

`GET https://lukeocodes.dev/search.json?q=<words>` returns matching posts as JSON, each with its page URL and its markdown URL. Add `&limit=<1-50>` for more than 10. How it works: [/blog/search](https://lukeocodes.dev/blog/search.md).

```sh
curl "https://lukeocodes.dev/search.json?q=developer+relations"
```

---

© 2026 Luke Oliff. Posts live at the root of this site.

- [GitHub](https://github.com/lukeocodes)
- [LinkedIn](https://www.linkedin.com/in/lukeocodes)
- [X](https://x.com/lukeocodes)
- [Bluesky](https://bsky.app/profile/lukeocodes.dev)
- [Email](mailto:luke@lukeoliff.com)
- [RSS](/rss.xml)

## Cookies

This site sets one analytics cookie, from Google Analytics, and only in a browser that accepts the cookie banner. A client that does not run scripts sets no cookies, so there is nothing to accept or decline here.

[Cookie policy](/cookies)
