Skip to main content
All CollectionsUsing PerforceGetting Started
Connecting to Perforce using old flow with p4host settings
Connecting to Perforce using old flow with p4host settings
Toshi Dávila avatar
Written by Toshi Dávila
Updated over a month ago

The Current Perforce depot connection is available using your server address and your user credentials, you can read more about it here.

If you want to use the previous flow with the "P4HOST" variable please follow the link from the Perforce Instructions page (below):

This will take you to the old instructions page where you can find "P4HOST" value and instructions how to apply it.

Make sure you've added a P4 tool to your Assembla Space. Hover over the green (+) button at the top of your screen and select Add P4 Repo to add an empty repository.

Configuring P4V

To install and configure for P4V

  1. Download and install latest P4V client from this link.

  2. Select the family and platform. The version is disabled because the latest version is selected by default.

  3. Open the installer, and then click Next.

  4. Type the Assembla p4 server found on your repository's instructions tab.

  5. Type your Assembla username.

  6. Verify the path to your editing application, and then click Next.

  7. Click Install if you have no changes.

  8. Once installation is complete, click Exit.

Adding the P4 repo to your computer

To add the P4 repo to your computer

  1. Create a folder in your computer and apply an appropriate name. For this example, we used “Assembla_Demo.” Note the path as you will need it later. The path for this example is D:\p4\assembla_demo.

  2. Create a text file called p4config.txt. It is very important it has this name and extension. In that file, put the information shown in your P4 instructions page in Assembla. For this tutorial, the information is:

    • P4PORT. ssl:perforce.assembla.com:1667

    • P4HOST. assembla-production-staging/assembla-production-staging-first-space.3

    • P4USER. Toshidavila

    • P4CLIENT. your_workspace_name (i.e. assembla_demo)

    • P4CHARSET. utf8

  3. Next, run a command to make P4 work.

    1. Open your prompt or press the Windows key + R, and a dialog appears at the bottom left.

    2. Type cmd and press Enter. A black window appears.

    3. Use the folder that you created in Step 1 to let Perforce know where our P4config file is. Type the following:
      p4 set P4CONFIG=”D:\p4\Assembla_Demo\p4config.txt”

    4. Press Enter. Now perforce knows where our p4config file is.

      Note: If you are using Windows, keep in mind that Windows will sometimes hide the file extension and add a .txt on top of what is visible in the File Explorer. To confirm your file's true name, right-click the file, select Properties, and select the Details tab to see your file's full name.

  4. Open P4V. If you are using Windows, press the Windows key from your keyboard, and then type "p4v".

  5. Type the name of the server and your username from before, and then click OK. Copy them from your instructions page as Perforce is case sensitive and will display an error if the name is not correct.

    Note: Leave the workspace field blank.

  6. Select Unicode (UTF-8) for the encoding, and then click OK.

  7. Type your Assembla password, and then click OK.


    P4V now should be viewable.

    If your repository has some content, you will see some workspaces to start working on. In the above example, this is an empty repository and we need to create our first workspace to start.

  8. Under Depot, click New Workspace.

  9. By default, you will see the workspace name and root with some values. If you work with more than one Perforce depot, it is preferred to create your workspaces in the same folder where you save your p4config.txt file to easily track where the files are and to which workspace they belong. For this example, we named the workspace “main” and the root is “D:\p4\Assembla_demo”.

  10. Now select a Stream by clicking Browse and searching for the appropriate item.

  11. Select the Mainline.


    Your screen should look similar to the following:

  12. Click OK. When you are prompted whether you want to choose a different location, click No.

  13. Now you are ready to start working! It should like like the picture below. Compare it with the one in Step 7. Now you have the main (mainline) in your dropdown, which is where you will be committing your files.

  14. Next, add and commit a file. Create a file in your folder, and it appears it under Workspace.

  15. Select the file you want to add, and then click Add. Click OK when asked to select the pending changelist. Your file appears on the commit list.

  16. You know a file is added because it has the red cross on the icon. Now click Submit.

  17. Type a description to let other users know what you are working on, like a summary of your changes. You can also relate your commits with a ticket you are working on in Assembla using the syntax "re #ticket_number".

  18. Click Submit. You will know that the file was submitted to your Assembla P4 repo because it has a green dot on its icon.

  19. Finally, go to your P4 repo in Assembla and you will see your file in your main stream!


If you have any questions or need our assistance, don't hesitate to contact us at support@assembla.com.

Did this answer your question?