All Collections
Using Perforce
Getting 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 week 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 hor 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.

Configure P4V

Download and install latest P4V client from this link.

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

Open the installer and click on Next.

Enter the Assembla p4 server found on your repository's instructions tab and your Assembla username

Click on Start

Click on Finish

Now let’s get the P4 repo in our computer

1. Create a folder in your computer and name it as you want. I will call mine “Assembla_Demo”, take note of the path, you will need it later. Mine 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. We need to run one command to make P4 work.

3.1 Open your prompt, or press the windows key + R, and a dialog will open at the left bottom.

3.2 Type cmd and hit enter. You will see a black window, but don’t worry, you just need to do this once.

3.3. Remember the folder you created in Step 1? Now we need to let perforce know where our P4config file is. Type this: p4 set P4CONFIG=”D:\p4\Assembla_Demo\p4config.txt”

3.4 Hit enter and that’s it. 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, click on "Properties", and select the "Details" tab to see your file's full name.

4. Open P4V. In you're using Windows, press the Windows key from your keyboard and type "p4v".

5. Enter the server and your username from before. Copy them from your instructions page, perforce is case sensitive and if you type anything wrong, it will throw an error.

Note: Leave the workspace field blank.

6. It will ask you for the encoding, select UTF-8

7. Now enter your Assembla password

8. Congrats, your P4V is now up!

9. 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. Under Depot, click on “New Workspace…

10. By default, you will see the workspace name and root with some values. I like to create my workspaces in the same folder where I save my p4config.txt file, so I can easily track where they are and to which workspace they belong to. This only makes sense for users who work with more than one P4 repo. I will name my workspace “main” and the root will be “D:\p4\Assembla_demo”

11. Now we need to select a Stream. Click on “Browse...” The the right of "Stream:" in the screen shown above. Then, select the Mainline.

12. It should look like this:

13. Click on OK. It will ask you if you want to choose a different location, click on No.

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

15. Let’s add a file and commit it. Create a file in your folder and you will see it under Workspace:

16. Select the file you want to add and click on Add. It will ask you to "select pending changelist", just click on OK and your file will be added to the commit list.

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

18. It will ask you to enter a description. This is used 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":

19. Click on Submit and you will know the file has been submitted to your Assembla P4 repo because it has a green dot on its icon:

20. 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?