Perforce

L33t software


Perforce is a centralized version control software system often used by game developers.

    • Server: As a centralized system perforce connects you do a server. It is called the Helix server or known by its program name, p4d. When using perforce for distributed versioning a local personal server is setup and it in turn is used to clone, fetch or push contents from the remote server.

    • Depot: A repository hosted by the server. A server can host multiple depots.

      • Local

      • Stream

      • Remote

      • Archive

      • Unload

      • Spec

    • Clients: To connect to a repository there are a number of clients: a command-line client (p4), a graphical user interface client (p4v) and various plug-ins that work with commercial IDEs and productivity software.

    • Workspace: You work on your file by editing them in your workspace. The workspace let you select what depots to use and where to store them on your computer when you work on them.

    • Changelist: When you submit your changes to the server they are stored as a changelist.

    • Streams: Stream are branches with rules and relations to other streams. They can be used in a stream depot and not in local depots.

      • Mainline

      • Release

      • Development

      • Taks

      • Virtual

    • Labels

    • Jobs

    • Check out/in

    • branches

Naming conventions

Depots, workspaces, labels and branches may not have the same name. So setup rules to avoid future confusion.

    • workspaces: user_machine_product_branch. Ex spinningcubes_laptop_simsmiley for the mainline workspace.

Activities

Create a depot in perforce

1. Start p4Admin

2. Select the menu File/New depot

3. Enter a name for you depot.

4. For depot type use local or stream.

5. Ok to create depot

Create a workspace

1. When connecting select New on the workspace line.

2. Name it using the Naming conventions section above or according to rules set by your perforce admin.

3. Select the workspace root where the files will be on your computer. Inside a folder with your workspace name.

4. Select the depots to include. Default will be all. Right click exclude tree on the ones you don't need.

5. Ok

Get the latest files in your workspace

1. Ctrl+0 to select the workspace tree.

2. In the workspace tree select your folder where the files will end up.

3. Select get latest in the toolbar.

4. If you do it on a new depot you will get a warning as there is now file inside it yet.

Add a readme to a empty depot

1. Ctrl+9 to go to your depot view. Note the name of your new depot.

2. Ctrl+0 to switch to workspace tree.

3. Right click the root folder of your workspace and select new folder.

4. Enter the name of your depot as the new folder.

5. Right click on your new folder and select show in/show in explorer

6. Explorer will open with your folder selected.

7. Enter the folder and create a readme.txt inside it.

8. In p4 right click folder and select mark for add and then ok.

9. Ctrl+1 show you the pending changelist of files to add.

10. Click submit, add submit message then ok.

11. Go to view/history to show changes in the selected folder.

Perforce Applications

p4 - command-line client

p4 set : List p4 set variables

p4 set P4IGNORE=.p4ignore

p4 ignores

p4v - graphical user interface client

    • Depot view

    • Workspace view

    • Pending view

    • Submitted

    • Workspaces

    • History

p4admin -

A GUI tool to perform basic Helix server administrative tasks. For full access to all actions the command-line client have to be used.

p4merge -

Official Links

Links