# Bun Configure git to diff Bun's lockb lockfile

> Configure git to diff Bun's lockb lockfile

- Skill: `jarle/bun-configure-git-to-diff-bun-s-lockb-lockfile` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jarle/bun-configure-git-to-diff-bun-s-lockb-lockfile`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jarle/bun-configure-git-to-diff-bun-s-lockb-lockfile/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jarle (https://skillmd.com/u/jarle)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/jarle/bun-configure-git-to-diff-bun-s-lockb-lockfile

---


# Configure git to diff Bun's lockb lockfile

<Note>
  Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without
  configuration, at no cost to performance. In 1.2.0+ it is the default format used for new projects. [**Learn
  more.**](/pm/lockfile#text-based-lockfile)
</Note>

***

To teach `git` how to generate a human-readable diff of Bun's binary lockfile format (`.lockb`), add the following to your local or global `.gitattributes` file:

```js gitattributes icon="file-code" theme={"theme":{"light":"github-light","dark":"dracula"}}
*.lockb binary diff=lockb
```

***

Then add the following to you local git config with:

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
git config diff.lockb.textconv bun
git config diff.lockb.binary true
```

***

To globally configure git to diff Bun's lockfile, add the following to your global git config with:

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
git config --global diff.lockb.textconv bun
git config --global diff.lockb.binary true
```

***

## How this works

Why this works:

* `textconv` tells git to run bun on the file before diffing
* `binary` tells git to treat the file as binary (so it doesn't try to diff it line-by-line)

In Bun, you can execute Bun's lockfile (`bun ./bun.lockb`) to generate a human-readable version of the lockfile and `git diff` can then use that to generate a human-readable diff.

