Welcome back.
Now this video is completely optional.
This video is for students who are already familiar with the git version control system.
Version control is a method of tracking the changes in your project, and easily being able to undo
those changes in order to get back to the last working state of your project, should things go wrong.
I always version control my projects, and if you aren't familiar with the git version control system,
that's fine.
You can safely skip this video and continue on with the next one.
This is the only lecture in the series where I show you any version control.
The reason I've included this video is because I thought that students who already use git to version
control their projects might like to see my workflow for setting up git to version control my Unreal
Engine projects.
If you're interested in learning git to version control your projects, I have a course called the Ultimate
Git Course with applications in Unreal Engine.
But again, this is not a requirement nor a prerequisite for this course.
So again, if you're not already familiar with git.
Go ahead and skip this video and continue on with the next one.
Now I'd like this to be version controlled on an online repo on my GitHub page.
So I'm going to create a new repository here on GitHub.
And I'm going to call this gameplay ability system underscore aura.
Now I can have a description if I like I can say online repo for gameplay ability system course.
And this will be a public repository.
Now I don't need to add a Readme or a git ignore.
I like to do those locally before pushing up to my remote repository.
So I'm simply going to click create repository.
And GitHub so conveniently reminds me of the syntax for pushing a local repo up to my remote here.
So that means I need a local repo here.
And I like to work from the git bash because it's simple and clean.
so I'm going to go ahead and open the git bash and maneuver into the folder I have here.
I can do that with CD slash c slash gas slash ora.
And I can initialize a new repository here.
Now I'd like to add a git ignore so that I'm ignoring certain files.
And I have a handy git ignore that I typically copy and paste in which I use for all my files.
For example, here's my slash project from the Unreal Engine five Ultimate Game Developer course.
Here's my git ignore for it.
As you can see, it's got some things that we can ignore.
I'm going to go ahead and choose not to ignore these folders.
Most of them don't exist in my project now.
The assets folder I could ignore if I'd like to just version control the source code, but in this case
I'm going to go ahead and not get ignore any of these and I'm not going to get ignore my content folder.
I'd like to version control that, but everything else here can be git ignored.
So I'm going to go ahead and copy all this.
Now I don't want to change my git ignore for the slash project.
I want to make a new text document called simply dot git ignore.
Yes, I'm sure I want to change the file type, and I'm going to open it up here and paste in those
contents and save it.
So I now have a git ignore for the project.
Now I'm ready to initialize my repo.
Now GitHub is giving me some commands here.
It's reminding me that git init is how I'm going to initialize a new repo, so I'd like to do that here.
Git init I can also run git status to see that I have these files which have not been staged or committed.
Now, if you don't know what staged or committed means and you'd like to learn more about version control,
I highly recommend you take my course on git, where you can learn all about how version control and
git works.
What I can do though is I can stage these files with git add.
It'll take a while because I have my content folder here, and if I now run git status, I see all those
files that are not get ignored and there's quite a lot of them.
And finally, I can make my first commit and this will say initial project files.
And if I run git log I see that there's my first commit.
Git status shows me there's nothing to commit.
All the changes are up to date.
Now, what I next need to do is push this up to my remote.
We see that GitHub tells us to use this line, making sure that our main branch is called main.
Mine's already called main, so I don't need to rename it.
But what I can do is I can add the remote.
It's giving me the URL for it here.
I can copy that and paste it right here into the git bash to add that remote.
Now if I run git remote I have origin git remote.
Dash v shows me the origin and its URL.
And finally I can use git push dash you to push upstream.
So I'm going to go ahead and paste that in.
And this is quite a big push.
I have data packs with GitHub by default.
You can't really push that much data on the free plan.
I do have data packs that allow me to push more data than the default, so I'm going to give this some
time to push to my remote repository.
Okay, so now that I'm finished pushing to my online repository, I'm going to pull it back up here
on GitHub.
I'm going to refresh it.
And now I can see that I have my new project here.
I have my content folder.
I don't have a source folder yet.
Right.
This is just a blueprint project.
But now I can make changes locally and push them up here to my GitHub repo and everything will be fine.
Now you might be wondering why I haven't set up git LFS.
I typically don't use git LFS.
It might sound strange, but you can actually version control an Unreal Engine project without using
git LFS.
It's true and that's how I'm going to be doing it.
But this course is not about version control, it's about the gameplay ability system, which we can
now start getting into now that our project is set up.
I've got version control.
You don't have to have version control for yours, but if you followed along now you have version control
and you can make commits so that you'll be saved.
If your project gets into a state where it is no longer working and will be in the habit of making git
commits at the end of each lecture.
So now that we're ready to start making some classes and coding some gameplay mechanics, we'll get
started with that in the next video.
I'll see you then.