WEBVTT

00:07.160 --> 00:08.180
Welcome back.

00:08.180 --> 00:10.610
Now this video is completely optional.

00:10.610 --> 00:15.560
This video is for students who are already familiar with the git version control system.

00:15.560 --> 00:21.200
Version control is a method of tracking the changes in your project, and easily being able to undo

00:21.200 --> 00:26.240
those changes in order to get back to the last working state of your project, should things go wrong.

00:26.240 --> 00:31.280
I always version control my projects, and if you aren't familiar with the git version control system,

00:31.280 --> 00:32.120
that's fine.

00:32.120 --> 00:35.450
You can safely skip this video and continue on with the next one.

00:35.450 --> 00:39.110
This is the only lecture in the series where I show you any version control.

00:39.110 --> 00:43.730
The reason I've included this video is because I thought that students who already use git to version

00:43.730 --> 00:48.800
control their projects might like to see my workflow for setting up git to version control my Unreal

00:48.800 --> 00:49.790
Engine projects.

00:49.790 --> 00:54.710
If you're interested in learning git to version control your projects, I have a course called the Ultimate

00:54.710 --> 00:57.110
Git Course with applications in Unreal Engine.

00:57.110 --> 01:01.850
But again, this is not a requirement nor a prerequisite for this course.

01:01.850 --> 01:04.540
So again, if you're not already familiar with git.

01:04.570 --> 01:08.440
Go ahead and skip this video and continue on with the next one.

01:08.470 --> 01:14.410
Now I'd like this to be version controlled on an online repo on my GitHub page.

01:14.410 --> 01:18.520
So I'm going to create a new repository here on GitHub.

01:18.520 --> 01:24.490
And I'm going to call this gameplay ability system underscore aura.

01:24.520 --> 01:35.950
Now I can have a description if I like I can say online repo for gameplay ability system course.

01:35.950 --> 01:39.220
And this will be a public repository.

01:39.250 --> 01:42.370
Now I don't need to add a Readme or a git ignore.

01:42.400 --> 01:47.650
I like to do those locally before pushing up to my remote repository.

01:47.650 --> 01:51.400
So I'm simply going to click create repository.

01:51.400 --> 01:59.740
And GitHub so conveniently reminds me of the syntax for pushing a local repo up to my remote here.

01:59.740 --> 02:02.980
So that means I need a local repo here.

02:02.980 --> 02:07.570
And I like to work from the git bash because it's simple and clean.

02:07.570 --> 02:15.030
so I'm going to go ahead and open the git bash and maneuver into the folder I have here.

02:15.030 --> 02:21.960
I can do that with CD slash c slash gas slash ora.

02:21.990 --> 02:24.840
And I can initialize a new repository here.

02:24.870 --> 02:30.120
Now I'd like to add a git ignore so that I'm ignoring certain files.

02:30.120 --> 02:37.140
And I have a handy git ignore that I typically copy and paste in which I use for all my files.

02:37.140 --> 02:43.560
For example, here's my slash project from the Unreal Engine five Ultimate Game Developer course.

02:43.560 --> 02:45.750
Here's my git ignore for it.

02:45.750 --> 02:49.710
As you can see, it's got some things that we can ignore.

02:49.740 --> 02:54.390
I'm going to go ahead and choose not to ignore these folders.

02:54.390 --> 02:57.060
Most of them don't exist in my project now.

02:57.060 --> 03:04.530
The assets folder I could ignore if I'd like to just version control the source code, but in this case

03:04.530 --> 03:12.560
I'm going to go ahead and not get ignore any of these and I'm not going to get ignore my content folder.

03:13.520 --> 03:17.810
I'd like to version control that, but everything else here can be git ignored.

03:17.810 --> 03:21.170
So I'm going to go ahead and copy all this.

03:21.200 --> 03:25.460
Now I don't want to change my git ignore for the slash project.

03:25.460 --> 03:32.360
I want to make a new text document called simply dot git ignore.

03:33.410 --> 03:39.500
Yes, I'm sure I want to change the file type, and I'm going to open it up here and paste in those

03:39.500 --> 03:41.330
contents and save it.

03:41.330 --> 03:44.780
So I now have a git ignore for the project.

03:44.810 --> 03:48.170
Now I'm ready to initialize my repo.

03:48.200 --> 03:51.890
Now GitHub is giving me some commands here.

03:51.890 --> 03:58.730
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.

03:58.850 --> 04:08.030
Git init I can also run git status to see that I have these files which have not been staged or committed.

04:08.060 --> 04:13.460
Now, if you don't know what staged or committed means and you'd like to learn more about version control,

04:13.460 --> 04:20.290
I highly recommend you take my course on git, where you can learn all about how version control and

04:20.290 --> 04:21.190
git works.

04:21.190 --> 04:26.590
What I can do though is I can stage these files with git add.

04:26.620 --> 04:34.180
It'll take a while because I have my content folder here, and if I now run git status, I see all those

04:34.180 --> 04:38.200
files that are not get ignored and there's quite a lot of them.

04:38.200 --> 04:48.670
And finally, I can make my first commit and this will say initial project files.

04:49.510 --> 04:53.530
And if I run git log I see that there's my first commit.

04:53.560 --> 04:56.260
Git status shows me there's nothing to commit.

04:56.260 --> 04:58.600
All the changes are up to date.

04:58.630 --> 05:03.400
Now, what I next need to do is push this up to my remote.

05:03.400 --> 05:09.820
We see that GitHub tells us to use this line, making sure that our main branch is called main.

05:09.820 --> 05:12.730
Mine's already called main, so I don't need to rename it.

05:12.730 --> 05:15.940
But what I can do is I can add the remote.

05:15.940 --> 05:19.050
It's giving me the URL for it here.

05:19.050 --> 05:25.560
I can copy that and paste it right here into the git bash to add that remote.

05:25.590 --> 05:30.750
Now if I run git remote I have origin git remote.

05:30.750 --> 05:35.700
Dash v shows me the origin and its URL.

05:35.700 --> 05:41.790
And finally I can use git push dash you to push upstream.

05:41.790 --> 05:44.370
So I'm going to go ahead and paste that in.

05:44.700 --> 05:46.980
And this is quite a big push.

05:46.980 --> 05:50.130
I have data packs with GitHub by default.

05:50.130 --> 05:54.000
You can't really push that much data on the free plan.

05:54.000 --> 06:00.750
I do have data packs that allow me to push more data than the default, so I'm going to give this some

06:00.750 --> 06:04.560
time to push to my remote repository.

06:05.310 --> 06:12.180
Okay, so now that I'm finished pushing to my online repository, I'm going to pull it back up here

06:12.180 --> 06:12.810
on GitHub.

06:12.810 --> 06:14.430
I'm going to refresh it.

06:14.430 --> 06:17.910
And now I can see that I have my new project here.

06:17.910 --> 06:19.620
I have my content folder.

06:19.620 --> 06:21.600
I don't have a source folder yet.

06:21.620 --> 06:22.160
Right.

06:22.190 --> 06:24.170
This is just a blueprint project.

06:24.170 --> 06:32.120
But now I can make changes locally and push them up here to my GitHub repo and everything will be fine.

06:32.120 --> 06:35.960
Now you might be wondering why I haven't set up git LFS.

06:35.960 --> 06:38.570
I typically don't use git LFS.

06:38.600 --> 06:44.060
It might sound strange, but you can actually version control an Unreal Engine project without using

06:44.060 --> 06:44.990
git LFS.

06:45.020 --> 06:47.930
It's true and that's how I'm going to be doing it.

06:47.930 --> 06:54.320
But this course is not about version control, it's about the gameplay ability system, which we can

06:54.320 --> 06:57.320
now start getting into now that our project is set up.

06:57.320 --> 06:58.910
I've got version control.

06:58.940 --> 07:04.760
You don't have to have version control for yours, but if you followed along now you have version control

07:04.760 --> 07:07.880
and you can make commits so that you'll be saved.

07:07.880 --> 07:14.090
If your project gets into a state where it is no longer working and will be in the habit of making git

07:14.090 --> 07:16.700
commits at the end of each lecture.

07:17.000 --> 07:22.370
So now that we're ready to start making some classes and coding some gameplay mechanics, we'll get

07:22.370 --> 07:23.930
started with that in the next video.

07:23.930 --> 07:25.130
I'll see you then.
