p4 prune


Removes unmodified files from a stream.

The p4 prune command is equivalent to the p4 obliterate command, except that it can be done by the stream owner rather than an administrator.


p4 [g-opts] prune [-y] -S stream


The p4 prune command permanently removes unmodified files (files with one revision) from a stream that is no longer being actively used. Only the owner of a stream may prune it.

By default, p4 prune displays a preview of the results. To execute the operation, issue the command again, this time using the -y option.

After a stream has been pruned, files with more than one revision remain in the stream so that their edit history is preserved. Unmodified files are gone as if obliterated by an administrator with the p4 obliterate command.

Pruned files remain in client workspaces until the next p4 sync command runs, which removes them. If pruned files have been branched to a child stream, new integration records are generated to directly link the branched files in the child stream to the files in the parent stream that they were previously related to indirectly.

Mainline, task, and virtual streams may not be pruned. To remove unmodified files from a task stream, delete or unload the stream using the p4 stream or p4 unload command. The unmodified files automatically go away when the stream spec does.

The stream owner who executes this command must have write access, as granted by the p4 protect command.



Execute the command. Without this option, the command previews the results but takes no action.


The name of the stream you want to prune.


See the “Global Options” section.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required



write for stream owner

Related Commands

An equivalent for p4 obliterate -ahbi

p4 obliterate