Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Documentation | 2025.2

# p4 zip

(DVCS) Package a set of files and their history for use by `p4 unzip`.

## Syntax

    p4 zip -o file [-r remote -A -I] [filespec | -c change]
    p4 zip -o file -A [-r remote  -I] -s shelf

Syntax and naming conventions

## Description

Writes the following to the specified zip file:

- The specified set of files.
- The changelists that submitted those files.
- The files' attributes.
- Any fixes association with the changelists.
- All integration records that describe integrations to the files being zipped.

The content of the zip file can be specified either by providing a filespec, which selects a set of revisions, or by providing one or more changelist numbers using the `-c` option, which selects all the revisions modified by those changelists.

The second form of the command writes a single shelved changelist to the specified zip file. When you use the `-s` option, you must also use the `-A` option.

The zip appears either in the server installation directory (P4ROOT) or the path that you specify in the file option.

For a walkthrough, see the Perforce Knowledge Base article, How to move data from one Perforce VCS server to another Perforce VCS server using p4 zip and p4 unzip.

## Options

Option | Description
--- | ---
`-A` | Include the archive content of the new revisions.
`-c change` | Zips up just the files covered by the specified changelist.
`-I` | Excludes integration records for the new revisions.
`-o filename` | Specifies the zip file name.
`-r remotespec` | Specifies the remote spec to be used to re-map the files when they are written to the zip file.
`-s` | Specifies a shelved changelist to be zipped, instead of one or more submitted changelists. For more information, see the section "Fetch and push a shelved changelist" in the P4 Server Administration Documentation.
`filespec` | Specifies the filepath of the files to zip up.

## Examples

`p4 zip -o foo //...` | Creates a zip file named `foo` with all changes and revisions.

## Usage notes

Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required
--- | --- | ---
N/A | N/A | `super`

## Related commands

Import files from a `p4 zip` package file | `p4 unzip`

Your search for returned results