Jump to content


How do I properly check into a remote Perforce server? Seems to only work locally.

P4

  • Please log in to reply
4 replies to this topic

#1 FMastro

FMastro

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 11 September 2019 - 04:11 PM

I've heard that Perforce is best for game development due to the large files. I've used Git and SVN in the past and this is the first time using Perforce, but I'm having issues or a lack of understanding. All the videos I watch seem to have the server and client on the same machine.

It seems I run into two problems

A) If I create the workspace on the remote server and try to connect to it from the client machine, I get the message "Client "Test" can only be used from the host 'X". So I can't use workspaces created on the remote server

B) If I create the workspace on the client, while connected to the remote server. It seem the files only get stored on the client and there's no way for me to "Push" (to use Git terms) to the server and have someone else "Pull" from the server to their local.

Any help with understanding this and how to actually check my code into the server would be great. Thank you!

#2 P4Karl

P4Karl

    Advanced Member

  • Administrators
  • 58 posts

Posted 13 September 2019 - 01:59 PM

Hi,

The workspace/client is host locked to the machine it was created on. If you look at the client definition in P4V or at the command line you will see the 'Host:' field. If you change this to the local PC you will be able to submit. For example at the command line:

p4 -p my_host:1666 -u my_user -c my_client login
p4 -p my_host:1666 -u my_user -c my_client client
# Change the host field.
# cd into your workspace
# Then add all the files under the current directory:
p4 -p my_host:1666 -u my_user -c my_client add ...   
p4 -p my_host:1666 -u my_user -c my_client submit

This can also be done in P4V.

Regards,

Karl

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 979 posts

Posted 13 September 2019 - 02:59 PM

View PostFMastro, on 11 September 2019 - 04:11 PM, said:

B) If I create the workspace on the client, while connected to the remote server. It seem the files only get stored on the client and there's no way for me to "Push" (to use Git terms) to the server and have someone else "Pull" from the server to their local.

Creating the workspace on the client is the correct thing; Perforce is a client-server system, where everything lives on one central server that any number of clients connect to (svn was largely inspired by Perforce, so if you've used svn before the architecture is similar).

To push your files to the server, open the files for add ("p4 add" or "Mark for Add") and then submit ("p4 submit" or "Submit...") them.  When another client syncs ("p4 sync" or "Get Latest"), their workspace is synced up with the latest version of everything that's on the server.

#4 FMastro

FMastro

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 13 September 2019 - 11:11 PM

Sorry I didn't mean to post this twice. I couldn't tell when I did the first one, didn't realize it was moderated.
Thanks for the help. Got it working, I didn't realize I needed to create a folder the mirrored the depot name first on a new depot. That was one major issue I was having. Thought it would create it itself.

#5 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 979 posts

Posted 14 September 2019 - 07:19 AM

View PostFMastro, on 13 September 2019 - 11:11 PM, said:

Sorry I didn't mean to post this twice. I couldn't tell when I did the first one, didn't realize it was moderated.
Thanks for the help. Got it working, I didn't realize I needed to create a folder the mirrored the depot name first on a new depot. That was one major issue I was having. Thought it would create it itself.

People frequently get tripped up by needing to create an "extra" folder in their workspace, so it's not just you.  :)  When you create your client spec, you define via the View and Root what folder your files will come from.  If you have more than one depot, the default view maps files to each depot from a folder that has the same name as the depot, e.g.:

Root: c:\p4
View:
	//depot/... //my_client/depot/...

With this client spec, you can't add files directly from C:\p4, because only C:\p4\depot is mapped in the view.  The fix for this is to change the view to map //depot directly to the client root:

Root: c:\p4
View:
	//depot/... //my_client/...

Now C:\p4 maps to //depot on a one-to-one basis, so anything you add from C:\p4 goes straight into //depot with no extra folder level needed in the workspace.





Also tagged with one or more of these keywords: P4

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users