Search code examples
synchronizationperforceworkspacep4vdepot

P4V/P4 sync a workspace folder to depot


In my local workspace folder, I add/update/delete files and want them synchronise to depot. The number of files is large, and I want P4V/P4 to automatically detect and synchronise it, just like SVN/Git.

However it seems not very easy in Perforce for this simple purpose... Checking out the whole folder in P4V only detect the updated files, "Mark for Add" can detect added files, but there seems to be no way to detect deleted files, other than manual "Mark for Delete".

I found that P4 has a sync command, but it seems only from depot to workspace?

Any help please?

Workspace in P4V:

Workspace

Depot in P4V:

Depot


Solution

  • To ask Perforce to figure out what files you have added, updated, or deleted on your workstation's disk, the command you're looking for is "reconcile".

    (As you noticed, "sync" gets changed files from the server, which is also useful, but isn't what you're trying to do -- you're trying to go the other direction, take changed files from your local workstation, and submit them to the server).

    There's good information in these related questions: How to reconcile newer workspace files with depot in Perforce? and Perforce reconcile offline work doesn't notice the changes

    And also check this article for lots of other alternate approaches and techniques: http://answers.perforce.com/articles/KB/3481/?q=working+disconnected+from+the+server&l=en_US&fs=Search&pn=1