bun --version vs. bun --revision

bun --version vs. bun --revision
Photo by orva studio / Unsplash

When I wanted to write an issue in Bun's GitHub repository, it said, please include the version of Bun you are using, type bun --revision. This is useful for Bun team to exactly know which version when user found the issue.

Why isn't it bun --version, but instead bun --revision?

The following is an explanation of the difference between bun --version and bun --revision, which at first glance are similar but different.

Let's try typing on my machine first.

bun --version
# output 1.1.27

bun --revision
# output 1.1.27+267afa293

Here is the brief explanation.

bun --version

  • Purpose: Prints the current version of Bun in a semantic versioning (SemVer) format, such as "1.1.27".
  • Output: Displays the version number that indicates the major, minor, and patch releases of Bun.
  • Use Case: Useful for checking if you have the latest version of Bun installed or when troubleshooting compatibility issues.

bun --revision

  • Purpose: Prints the exact Git commit hash that was used to compile the Bun binary you're currently using.
  • Output: Displays a long hexadecimal string representing the specific Git commit.
  • Use Case: Primarily for developers and advanced users who need to identify the precise codebase and bug fixes included in their Bun installation. It's helpful for debugging issues related to specific commits or for reporting bugs to the Bun development team.

Key Differences:

  • Format: bun --version outputs a SemVer formatted version number, while bun --revision displays a Git commit hash.
  • Level of Detail: bun --version provides a general overview of the Bun version, while bun --revision offers a more granular view of the specific codebase.
  • Use Cases: bun --version is commonly used for general version checking, while bun --revision is more relevant for developers and troubleshooting specific issues.

In summary, bun --version provides a general overview of the Bun version, while bun --revision offers a more detailed look at the specific Git commit used to build the binary. Choose the appropriate command based on your specific needs and the level of information required.

Hope it helps.

Support Us