• Perforce configuration details like current user, current workspace and other details
    p4 info
  • Current working workspace and logged in user
    p4 set P4CLIENT
  • Change the workspace
    // Change the workspace to 'client1'
    p4 set P4CLIENT=client1
  • Login to P4 on terminal
    p4 login
  • Get latest revision of the files
    p4 sync
  • Force sync only deleted files
    // Pipe the output of the diff command to the sync command. The -sd switches are used on the diff command to return only missing files.
    p4 diff -sd -f | p4 -x - sync -f
  • Force sync only changed files
    // The -se switch used on the diff command to return only changed files.
    p4 diff -se -f | p4 -x - sync -f