rembrembdocs

Skip to main content

Bun home pagelight logodark logo

[Runtime

](../../../index.md)[Package Manager

](../../../pm/cli/install/index.md)[Bundler

](../../../bundler/index.md)[Test Runner

](../../../test/index.md)[Guides

](../../index.md)[Reference

](https://bun.com/reference)[Blog

](https://bun.com/blog)[Feedback

](../../../feedback/index.md)

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.


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:

gitattributes

*.lockb binary diff=lockb

Then add the following to you local git config with:

terminal

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:

terminal

git config --global diff.lockb.textconv bun
git config --global diff.lockb.binary true

[​

](#how-this-works)

How this works

Why this works:

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.

Was this page helpful?

Suggest editsRaise issue

[

Migrate from npm install to bun install

Previous

](../from-npm-install-to-bun-install/index.md)[

Install dependencies with Bun in GitHub Actions

Next

](../cicd/index.md)