Commands reference

All P4 commands are available from the Visual Studio Code Command Palette. type

Open the Command Palette from the View menu bar and type P4: to view the full list of available commands.

This topic provides a reference to commonly used P4 commands, organized by category.

Authentication and information

Commands in this group display connection details and manage session state. For setup and login guidance, see Configure and log in to P4 Server .

Command

Description

P4: Log out of P4

Log out from the P4 Server

P4: Display client/server information

Display current connection details

P4: Show Output

Open the P4 output log

P4: Refresh

Refresh the Source Control view

P4: Refresh (clean)

Force a full clean refresh of Source Control

Changelist management

Commands in this group support creating, editing, viewing, moving, and submitting changelists. For task‑based guidance, see Manage changelists.

Command

Description

P4: Create changelist in editor

Create a new pending changelist using the spec editor

P4: Edit changelist description

Edit the description of an existing changelist

P4: Edit changelist spec

Edit the full changelist specification

P4: View Changelist

View a read‑only summary of a changelist

P4: Submit Default Changelist

Submit all files in the default changelist

P4: Submit changelist

Submit a specific changelist

P4: Submit selected files

Submit only selected files

P4: Go to changelist

Open a changelist by number

P4: Move to changelist

Move a file to a different pending changelist

P4: Delete changelist

Delete an empty pending changelist

P4: Copy changelist number

Copy the changelist number to the clipboard

Diff and history

Commands in this group help you inspect file history, view diffs, and annotate files. For usage details, see Inspect files and changes.

Command

Description

P4: Diff

Diff the workspace file against the depot head revision

P4: Diff revision

Diff against a specific revision

P4: Diff against the previous revision

Diff against the previous revision of the current file

P4: Diff against the next revision

Diff against the next revision (available only when viewing a depot revision)

P4: Diff two specific files / revisions

Diff any two selected files or revisions

P4: Open Diff

Open the diff editor for a file selected in Source Control

P4: Annotate

Show inline annotation (blame) for the current file

P4: History

View all revisions of the current file

File operations

Commands in this group support editing, adding, reverting, syncing, moving, and deleting files under the P4 Server. For procedures and examples, see Manage files.

Command

Description

P4: Add

Mark the current file for add to the depot

P4: Edit

Open the current file for edit

P4: Edit and Save

Open the current file for edit and save it in one step

P4: Delete

Mark the current file for delete

P4: Revert

Revert the current file to its last synced revision

P4: Move

Move or rename the open file while preserving file history

P4: Sync

Sync the entire workspace to the latest revision

P4: Sync file

Sync only the open file to the latest revision

P4: Sync file revision

Sync the open file to a specific revision

Jobs and specs

Commands in this group support working with Perforce jobs and editing specs. For task‑based guidance, see Manage jobs and Use the spec editor.

Command

Description

P4: Link Job

Attach a job to a changelist

P4: Unlink Job

Detach a job from a changelist

P4: View P4 Jobs

View jobs linked to a changelist

P4: Create job in editor

Create a new job using the spec editor

P4: Go to job

Open a job by ID

P4: Apply Edit

Apply edits to a changelist or job spec

Resolve

Commands in this group help you resolve file conflicts before submitting changes. For detailed steps, see Resolve conflicts.

Command

Description

P4: Resolve

Resolve conflicts for selected files

P4: Resolve changelist

Resolve all conflicts in a changelist

P4: Re‑resolve changelist

Re‑run resolve for a changelist

Commands in this group support searching and filtering changelists. For workflows and examples, see Search changelists.

Command

Description

P4: Go to changelist

Open a changelist by number

P4: Reset all filters

Clear all changelist search filters

P4: Add/Edit/Remove file filter

Manage file filters in changelist search

P4: Pin results / Unpin results

Keep or release search results

P4: Refresh this search

Re‑run the current search

Shelve

Commands in this group let you shelve, unshelve, and delete shelved changes. For workflows and constraints, see Shelve and unshelve changes.

Command

Description

P4: Shelve file

Shelve a single open file

P4: Unshelve file

Unshelve a single shelved file

P4: Shelve changelist

Shelve all files in a changelist

P4: Shelve and revert changelist

Shelve all files and revert local copies

P4: Unshelve changelist

Unshelve all files in a changelist

P4: Delete shelved files

Delete all shelved files in a changelist

P4: Delete shelved file

Delete a single shelved file