Perforce not syncing files correctly

前端 未结 7 825
广开言路
广开言路 2021-01-01 11:10

I\'m using Perforce P4V, the graphical tool, to interface with my Perforce server here at work. I have a project I added to the depot and I accidentally deleted it from my

相关标签:
7条回答
  • 2021-01-01 11:55

    For people coming into this question, this worked for me on the mac command line ...

    cd into your local perforce workspace - the base directory of the checked out files that you are working on.

    p4 sync -f
    

    -f is to force the sync.

    This can also come in handy when you restore a mac from a time machine backup.

    https://www.perforce.com/perforce/r12.1/manuals/cmdref/sync.html

    0 讨论(0)
  • 2021-01-01 11:56

    Like other people have mentioned, one solution is to do a "force sync" the entire depot which is basically overwriting everything from server into your local. The downside to this is that it could take a LONG time to finish if you are working on a big depot.

    Another alternative is to compare your local workspace with the server, then only force sync the files that are missing from your workspace.

    p4 diff -sd //Depot/path/… | p4 -x – sync -f
    

    -sd option: Show only the names of unopened files that are missing from the client workspace, but present in the depot.

    There are more options (sa/se/etc.) available if -sd is not what you need. see here.

    credits for the command goes to this blog.

    0 讨论(0)
  • 2021-01-01 12:01

    I did as you suggested, but I kept getting the message that the files were still open for edit and cannot be deleted, when trying Remove from Workspace.

    Also, Get Revision returned with a message that no files were updated.

    What I ended up having to do was Revert the files, then do the Get Revision action, that solved the problem.

    0 讨论(0)
  • 2021-01-01 12:02

    "Get Revision" will update only files that are not opened (checked out) even when "Force Operation" is enabled. You should revert all files marked as checked out in that workspace, and then use "Get Revision" with "Force Operation"

    0 讨论(0)
  • 2021-01-01 12:03

    Check out the file, change it a little bit and then revert. Perforce will replace the local file with the latest revision.

    0 讨论(0)
  • 2021-01-01 12:04

    They won't update because according to Perforce you still have the files on your local machine.

    You need to use the "Get Revison..." option and enable the "Force Operation" option.

    This will tell Perforce to refresh all the files even those it thinks you have the latest version of.

    0 讨论(0)
提交回复
热议问题