Full Video Transcript
Hello there. I'm Jase Lindgren, a solutions engineer at Perforce Software, and in this video I'm going to be going over the fundamentals of setting up a workspace in P4V. I'm gonna do that on both Windows and Mac, so you can see the differences. And this is the same on Linux as well, but these are the two that I'm showing here today.
So Helix Core is a centralized version control system, which means that the central server stores all of the history of all of the files, but that I can't work on them directly on the server. In order to do that, I need to sync some of those files to my local computer where I can work on them, make changes, and then submit the ones that I like back to the server. The idea here is that if I'm editing stuff directly on the server and I make a mistake or screw something up, I could mess up everybody's projects immediately. And I've worked at studios where this has happened where somebody accidentally does something wrong to a project and everybody in the room, their project crashes because we were all just working off of one network share.
So the idea here is that you're more intentionally able to evaluate, okay, are these changes ready and in a state for me to submit it? Okay, great. Let me go ahead and submit that with the knowledge that if I do screw something up, I can always get back to all of my previous versions. But it allows me to, hopefully cause less problems for my fellows that I'm working with and also to make it a little bit easier for me to look back through my history.
So let's go through setting up a workspace so that you can actually work on these files. So over here on the left in my depot tab, I can see all my different depots here. Hopefully your studio is using Streams Depots, which you can tell by this little blue squiggly here. If they're not, it means they're either an older studio that has some legacy projects in legacy Depots, which would look like this, just the plain depot icon without the squigglies.
Or there might be some particular reason, but hopefully they're using streams or at least moving toward using that because it makes the user experience much, much easier for your standard users. So in this case, we want to work in this jase_demo depot that I've set up here. You can think of a depot as the highest level container. Usually one project per depot.
It might be a little different at your company, but generally one project per depot and within a streams depot you will have multiple streams. In this case, I only have one. There's always going to be at least one mainline stream, and then you can have child streams off of that for development. In this case, I'm not gonna get into all of that.
That's generally something that your lead or your admin is going to tell you. You are going to work in this stream. So in this case, I'm gonna keep it simple. And in future videos we can cover different streams.
So here we have one mainline stream and that's what I wanna work on. What I'm gonna do is over here on the right, I'm going to go to, I personally prefer the stream graph here, which you can see gives me a visual representation, which is not very meaningful if you only have one. But if I were to show you an example here, if I have multiple streams, it gives me this nice visual relationship between all of them. And you can switch between which depot streams you're looking at through this over here.
So if I go to my jase_demo, I'll see I just have that one stream. I could also go to the streams tab. This one just shows a list of all of your streams. So I can see here in my stream root
which one it belongs to, right? So jase_demo/Main is the same as this here, jase_demo/Main. If I hover over it, I can see that path here as well. Either way, I'm going to right click on that stream and then I'm going to say New Workspace.
What the workspace is, is I'm telling it all of the files that are mapped to this stream, and that's something that your admin has taken care of for you, which is why it makes this so much easier for people to use. All the files that this stream is set up to see, I want to sync those to my local computer to be able to actually work on them and use them. So this opens up this workspace tab up here, and there are a few important things. So first is the workspace name.
What it defaults to is your username followed by your computer's name. And then the stream name that you clicked on. In this case mine was called Main, as you can see, and then a random number here. What I recommend is your username, your computer, or a way to remember this computer.
So I'll call this my Windows pc and then the name of the project. So in this case, I'll just call this demo. Now this workspace name is unique across the whole server, which is why I recommend putting your username and your computer name because if you connect and make a workspace on a different computer, you'll want that to be a different workspace with a different name. And then Workspace root,
this is where on my local computer am I going to put this? And by default as I change my workspace name, it will change this final folder name here, and on Windows, by default, it goes into users, your username, a folder called Perforce, and then the name of that workspace that you just gave it. However you could browse and put this wherever you want. And you can see here on MacOS same basic idea where I have my workspace name.
In this case I would put my username and then I would say, this is my MacBook. And then again, I would say, this is my demo project that I'm working on. You can see that it changed that folder there, but on a Mac its default place is going to be in slash users, your username slash perforce. So very similar path to what it was on Windows, but again, you can browse to anywhere.
Something I've seen a lot of people do that I like to do myself is to create a folder called P4 Workspaces or Helix Core or Perforce Workspaces or something like that. Just write on your C drive or D drive or right at your root, somewhere that you have access to so that you have a special place for these. What we're going to do now is, we have these first two set and then for stream, if you right, clicked on that stream, when you set this up, this will already be filled with that stream, but just in case it's not, you can also get to it by hitting browse here. And you can see that I can pull this open and see the same things we saw in that streams view before where it listed them.
Where I can go to jase_demo/main. That's my one stream that I have in my jase_demo project here. So I'll hit okay and you can see that fills it back in again. This part here, the workspace mappings.
This is stuff that you would have to set by hand if you were not using streams, but if you're using streams, as long as you set the stream there, this will all be filled out for you. Down at the bottom we have a couple options. One is to switch to the new workspace immediately. I recommend having that on, and the other is to automatically get all revisions.
I'm going to leave that off just to show you what that does. You'll also see that there's an advanced tab up here where we have some more options. There's a few of these I recommend, specifically mod time and remove directory. And then I also recommend changing On Submit to Revert Unchanged Files.
It is possible that your admin has set these up to be on by default, in which case you don't have to come over here and worry about it, which is great. And if you don't set those, don't worry about it. It makes things a little bit cleaner in my experience and a few things a little bit faster. But as it is right now should be fine.
So again, I have automatically get all revisions unchecked, and I wanna show you what happens here. I hit okay, and now you'll see this bar up here has switched to this new workspace that I created. And if I go to my workspace tab here, I'll see that I now have this folder on my local machine, which you can see is in my users username perforce directory, just like we set it up. On MacOS same thing would happen here.
If I go to my workspace, it's in my user directory. There it is. Now keep in mind, these are two separate workspaces. Workspaces should be unique per user and per machine that you're working on and per project, or you could even have multiple per project if you want.
That's something a little more advanced we can get into later. But to go back to my Windows set up here, I have my workspace, and you'll see I have that folder. And if I right click on this, I can go to the bottom here, show in, show in Explorer. And what this will do is open my Windows Explorer to that directory.
But you'll notice nothing is in here. And if I go to my depot tab and I check what's on the server, I see there's all these files here.
That's because I haven't synced them. I haven't gotten the latest revisions yet. So the way I can do that is by clicking on this parent directory here, and I can click this button up here that says Get Latest, or I can right click and say Get Latest Revision here. Generally speaking, if there's a button for something up here, you can also get to it through a right click.
I tend to use a right click for everything just because I always know the options are gonna be there. Uh, but that could be different for you. And of course there's also a hot key control shift G in this case, or if I go again over here on a Mac, this one doesn't have a hotkey by default, but get latest revision is right there. Or I can click this and say, get latest at the top right.
So there's always gonna be at least two, usually three different ways to do the same thing. Just be aware of that and try not to be overwhelmed by it. So you can see here. That I can come along and click get latest with this root folder selected, or I can write, click say get latest revision.
And I had this little progress bar go by here. It went by very fast because this is a small project. If you have a larger project or a slower internet connection, that might take a little bit longer. But then you can see I now have all these files here on my workspace tab.
And if I go to my actual file explorer, I can see, look, I now actually have files and folders inside of this directory where I created my workspace. And this is where we can start from to actually open these files and work on them. A few last things about workspaces here. So one is if I need to edit my workspace after I've created it, if I'm in that workspace and I go up to this connection menu at the top and I can go down here to edit current workspace, if I do that, you'll see this is a similar dialogue to when we created the workspace in the first place.
But I could change what stream it's connected to here, which I don't want to do, but I could do that. I could also go into advanced change, some of those advanced settings, things like that. So just so you're aware, you can go in there like that. And then also to be aware that you can have multiple different workspaces.
So, for example, each depot is usually a different project, and you might even have different sub-projects within streams inside of that depot. But in any case, if you're gonna work on multiple different ones, you would have different workspaces for each of those. So in this case, you can see right here I'm working on a project that's in this jase_demo, but I have other workspaces on my computer. Your five most recent ones will show up here.
So I could go, for example, to this completely different one. That's an Unreal project. Or if I want to get to other ones, I can go to this workspaces tab, which again, if it's not open, I can click this little plus icon here and open up workspaces. And you can see these are all of the work workspaces that are owned by my current user.
Now you'll notice that. I have this one that I made on Windows, and I also have this one that I made on my MacBook, which if I switch to my Mac, you can see I'm in that one here. What's important to note is that if I tried to. If I come to this workspace that I made on this computer and I right click, I have an option to switch to this workspace.
That's the same as if I came up to this dropdown and picked it out, assuming it's in my, my latest there. I’ll say, I wanna switch to this work workspace. And you can see that switches to where it's looking. But if I tried to do that on this one, on another computer, you can see that I don't have that option because again, your workspace needs to be unique to not only you as a user, but also which machine you're on.
And the reason for that is that if I made changes to the files on this computer and then I went to another computer, Those files wouldn't change, right? Because they're local files on that computer. Those wouldn't be different. If I wanted to get them between the two computers, what I would do is submit those files to the server and then I could get those changes and so could anybody else on their machine.
And that is what we will get to next. I hope this intro to setting up a workspace in P4V was helpful. In the next video, I'm going to go over basic file operations, like checking out files to work on them and submitting those changes. So I will see you then.