Before we continue, it's important that we cover some basic terminology.
The module is the core primitive of Buf and the BSR. A module is a collection of Protobuf
files that are configured, built, and versioned as a logical unit. You created a module when
you initialized a
buf.yaml in the beginning of the tour.
A module is stored in a repository. A repository stores all versions of a module, where each version is identified by a commit and (optionally) a tag.
While roughly analogous to Git repositories, a BSR repository is only a remote location - there is no concept of a repository "clone". In other words, repositories do not exist in multiple locations.
A module has a
name, and has three components:
- Remote: The DNS name for the server hosting the BSR, i.e.
- Owner: The user or organization that owns the repository.
- Repository: The repository's name.
- The module
buf.build/alice/toolshas a remote
alice, and repository
- The module
buf.build/acme/weatherhas a remote
acme, and repository
petapis repository with the following command:
$ buf beta registry repository create buf.build/$BUF_USER/petapis --visibility publicFull name Createdbuf.build/$BUF_USER/petapis ...
7.3 Configure a
Move back into the
$ cd petapis
buf.yaml so that its
name matches the repository you just created:
version: v1+name: buf.build/$BUF_USER/petapis lint: use: - DEFAULT breaking: use: - FILE
Push the module to the
buf.build/$BUF_USER/petapis repository with the following command (in the
petapis directory containing the
$ buf push19bcefa1a736428d9e64d21c9191b213
Behind the scenes,
buf recognizes the
name in your
buf.yaml and pushes the module to the
repository. If successful, the generated commit identifies this current version of your module.
The commit you see will differ from the one shown here.