Perforce is a popular centralizedSource codeManagement tools are widely used in many European and American multinational companies. He can run on almost all windows, Linux, and Mac platforms and supports various access methods such as clients, command lines, IDE integration, operating system shell, and APIs. In addition, he is able to well support the simultaneous access of staff from large-scale software companies and well support the development of distributed teams across countries. It is also convenient to manage the perforce server. For example, Google uses perforce to manage source code.
1. Getting started with the perforce Client
* On the client side, we can use the P4 command line or UI-based p4v. At the same time, the client also has p4merge to help users execute diff and merge.
* On the client side, we can also use the IDE plugin to conveniently execute all the perforce operations in the IDE, or call APIs based on various languages in our automated scripts to execute perforce operations.
* Basic logon information: Server, user, workspace in p4v. Server indicates the address of p4server, user indicates the user ID, and workspace indicates the ing between server and local directory, in the P4 command, the corresponding environment variables are p4server, p4user, and p4client.
* Client indicates the ing between the server and the local directory. In p4v, it is new workspaces... and the corresponding P4 command is P4 client.
* Add the file mark for add in p4v and the corresponding P4 command P4 add.
* Mark for delete is the deleted file in p4v, and the corresponding P4 command is P4 Delete.
* Change the file to check out in p4v and the corresponding P4 command to P4 edit.
* Submit and modify the file in p4v as submit, and the corresponding P4 command is P4 submit.
* Synchronize the latestCodeIn p4v, the command is get latest reversion/get reversion..., and the corresponding P4 command is P4 sync.
* Each submission corresponds to a change list, which uniquely identifies one submission.
* Undo the modification before submission. In p4v, the value is revert unchanged files/revert files..., and the corresponding P4 command is P4 revert.
* Undo it after submission. In p4v, It is rollback... and the corresponding P4 command is actually P4 Sync + P4 submit.
* To view the version of a file or folder, set file history/folder history in p4v. The corresponding P4 command is P4 filelog.
* To modify the file or move the file directory, rename/move... is in p4v, and the corresponding P4 command is P4 move.
* To create a branch, you need to create a new branch mapping + integrate using branch maping... In p4v. The corresponding P4 command is P4 branch + P4 integrate.
* Merge: Resolve files in p4v. The corresponding P4 command is P4 resolve.
* The P4 Copy command is equivalent to P4 integrate + P4 resolve-.
* To create a label, you need to create a new label... + label... In p4v. The corresponding P4 command is P4 label + P4 tag.
* Compare the latest client version with the local version. In p4v, the version is diff against havereversion. The corresponding P4 command is P4 diff.
* Compare different files. In p4v, the command is diff against... and the corresponding P4 command is P4 diff2.
* View the files in the directory. In p4v, the file is in folder, and the corresponding P4 command is P4 files.
* P4 command P4 info or P4 set to view the information of the current P4 server and current client.
* The P4 command corresponding to the file content is P4 print.
* P4 command P4 where is used to view the path of a file on the server, client, and local.
2. Getting started with perforce Server
* Server runningProgramIt is p4d (if it is run as a service, it needs to be changed to p4s ).
* To support the development of distributed teams, you need to use proxy. The running program of proxy is P4P (if it is run as a service, you need to change it to p4ps ).
* You can use the svcinst provided by p4server to deploy multiple servers or proxies simultaneously on Windows.
* P4server can be deployed as a daemon (service) or xinetd service on Linux.
* You can use the p4admin UI tool to manage the server, or use the P4 command P4 user + P4 group + P4 protect to manage permissions, and use P4 monitor to monitor the server.
* Use the p4d command p4d-JC/JR to back up and restore the server.
* You can also use the P4 command P4 Admin for partial management, such as stopping the server and backing up the server.
* The command P4 replicate or P4 pull can be used to create a replicated server, which is used as a hot backup server for disaster recovery, or as an offline server to reduce the downtime of the mainserver during Backup.
* Replicated SERVER + p4broker to achieve the high availability of p4server, or as a readonly server to reduce the load of mainserver.
Complete!