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

P4 CLI Reference | 2025.1

# Basic examples

This section provides examples of simple command alias definitions and illustrates the many uses for even the simplest definitions.

- Help me remember who I am.

      me = set P4USER

- Help me feel more comfortable as a user of another source control system.

      checkout = sync
      commit = submit
      purge = clean
      stash = shelve
      stash-list = changes -s shelved

- Create a personalized status command that also shows files that need syncing.

      my-status = status && sync -n

- Set different defaults.

      annotate = annotate -u
      grep = grep -i
      changes = changes -u $(P4USER)

- Simplify system administration.

  Shutting down the server, displaying active users:

      halt = admin shutdown
      active-users = changes -m 3 &&
                     monitor show &&
                     lockstat

- Remembering to clean up empty changelists

      kill-shelf $(cl) = shelve -d -c $(cl) &&
                         change -d $(cl)

- Change the order of arguments.

      clone $(p4port) $(path) $(dir) = -d $(dir) -u bruges clone -p $(p4port) -f $(path)

  Now the following command does what you want:

      clone perforce:1666 //depot/main/p4...  ~/local-repos/main

Your search for returned results