Forrest logo
back to the bazel tool

bazel:tldr:230c3

bazel: Remove output files and stop the server if running.
$ bazel clean
try on your machine

The command "bazel clean" is used in the Bazel build system to clean (or delete) the output files and directories generated by previous build operations.

When you build a project with Bazel, it generates several output files and directories, such as compiled binaries, object files, and intermediate build artifacts. These files are stored in the "bazel-out" directory, as well as other directories specific to your project.

The "bazel clean" command helps you remove these generated files and directories, allowing you to start with a clean slate. By running this command, you ensure that all output files are deleted, and the next build operation will only create new files based on the current source files and dependencies.

It is important to note that "bazel clean" does not undo any changes made to your source files or project configuration. It only removes the build-related files.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the bazel tool