13

I am trying to get used to Perforce after using SVN where I was mostly using Commit and Get Latest.

But in perforce I am kind of confused.

What is the difference between terms Get Latest and Check-out in PerForce terminology?

Mithun Sreedharan
  • 49,883
  • 70
  • 181
  • 236
pencilCake
  • 51,323
  • 85
  • 226
  • 363

1 Answers1

25

From "Perforce Basic Concepts":

  • Get Latest (p4 sync) is about transferring files from the depot to your workspace.
  • Check-out (p4 edit) is about getting the latest version from the depot for editing.
    When files are checked out for edit, their permissions are set to read-write. When files are not checked out, Perforce sets them to read-only.

As mentioned in "Perforce not syncing files correctly", a refresh (p4 sync) will update only files that are not opened (checked out) even when "Force Operation" is enabled. (p4 sync -f).
So the true difference is that a "check out" marks a file as being modified, and protect it from any refresh (any "get latest" operation).

Mark comments (and amend the "difference" I just mentioned above):

If you run a "get latest" (or sync) on a file that is newer than the version that you have open for edit, that will set up a resolve conflict that needs to be dealt with.
So while the file won't be updated by a sync directly, Perforce will set up the conflict so that it can be updated by doing a resolve (and in fact, the resolve must be done before a file open for edit can be submitted).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    For completeness, it should be noted that if you run a "get latest" (or sync) on a file that is newer than the version that you have open for edit, that will set up a resolve conflict that needs to be dealt with. So while the file won't be updated by a sync directly, Perforce will set up the conflict so that it can be updated by doing a resolve (and in fact, the resolve must be done before a file open for edit can be submitted). – Mark Aug 24 '11 at 17:16