# Add a Git dependency (/guides/install/add-git)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 193 · updated: 2026-07-28 -->
Related: [Add a dependency](/guides/install/add.md), [Add a development dependency](/guides/install/add-dev.md), [Add an optional dependency](/guides/install/add-optional.md), [Add a peer dependency](/guides/install/add-peer.md), [Add a tarball dependency](/guides/install/add-tarball.md), [Install a package under a different name](/guides/install/npm-alias.md)

Bun supports directly adding GitHub repositories as dependencies of your project.

```sh icon="terminal" title="terminal" terminal
bun add github:lodash/lodash
```

***

This adds the following line to your `package.json`:

```json icon="file-json" title="package.json"
{
  "dependencies": {
    "lodash": "github:lodash/lodash"
  }
}
```

***

Bun supports a number of protocols for specifying Git dependencies.

```sh icon="terminal" title="terminal" terminal
bun add git+https://github.com/lodash/lodash.git
bun add git+ssh://github.com/lodash/lodash.git#4.17.21
bun add git@github.com:lodash/lodash.git
bun add github:colinhacks/zod
```

When possible, Bun downloads GitHub dependencies as HTTP tarballs, which is faster.

***

See [`bun install`](/pm/cli/install).
