‫Okay, so before we go any further, I would highly recommend that you create a git repository or initialize
‫a git repository and make commits throughout the course.
‫It doesn't have to be after every video, but whenever you see fit so you can save and version your
‫code.
‫All right.
‫So I'm going to do that now.
‫And this is the only commit I'm going to make on camera.
‫But I'll make that initial one on camera.
‫So I'm just going to close these up for now.
‫And we want to create a file in the root called dot git ignore.
‫And this will allow.
‫And I know a lot of you guys already know this, but for those of you that don't, this will allow us
‫to specify which files and folders we don't want to push to our git repo.
‫So I'm going to paste some in here and just go ahead and copy those.
‫So and I'll go through these real quick.
‫So we'll be using a package PHP package manager called composer to use an auto loader.
‫We'll be doing that later on.
‫And composer uses the vendor folder for its packages.
‫So we don't want to include that.
‫I did include node modules just in case you want to use any node modules with the node package manager.
‫We won't be but I always put it there anyways.
‫And then this config dbdb.
‫This is where our database credentials are going to go, so you definitely don't want to push that.
‫Dot env is a file that is often used for environment variables.
‫We're not going to have one, but I just like to put it anyways.
‫VS code will include just custom Visual Studio code settings.
‫You don't want to push that.
‫And then Dsstore is a file that's that is used in Mac OS that we also don't want to push.
‫All right.
‫So those are the only ones that that I could think of.
‫So let's save that and close it up.
‫And now we want to initialize a git repo.
‫So open up your terminal whether it's the integrated or regular.
‫And make sure you're in the work root directory.
‫And we're going to say git init.
‫So that'll initialize a git repository.
‫Now I want to add everything that we have so far.
‫So I'm going to say git add dot which means just get.
‫It means add all add everything except anything that's in that git ignore file.
‫And then we want to commit that to our local repository.
‫So we'll say git commit m.
‫And then we can put a comment I'm going to say initial.
‫Commit and we'll say started home view.
‫All right.
‫So now that's in our local repository.
‫So now we need to push to a remote repo.
‫And we're going to be using GitHub for that.
‫So I'm going to go ahead and open that up.
‫If you don't have a GitHub account just go ahead and create one.
‫And then once you do just click this plus icon up here and say new repository.
‫I'm going to call this work Obeah slash dash PHP, because I'll probably create another version of this
‫project using Laravel or something else.
‫And in the description we'll say simple job listing app.
‫Built with.
‫We'll say vanilla VP and I'm going to make this private for now.
‫All right.
‫So once we do that we just need to then add this as a remote repository.
‫So this command right here you can just copy that and then jump into your terminal paste that in okay.
‫We want to use the main branch.
‫Grab that command.
‫Paste that in.
‫And then we can make our first push with this command.
‫So git push u origin.
‫We're pushing the main main branch.
‫All right, so once I do that, if I come back over here and reload.
‫Now you'll see that those files have been added.
‫Okay.
‫If you want to add a read me you can.
‫I'm going to do that later on.
‫But I just wanted to include this video just to get you guys set up if you haven't used GitHub before.
‫But now any time you want to push your files, you just have to say git add and then your files.
‫If you want everything just dot and then then you'll have to do git commit.
‫Dash em and then whatever comment you'll put in the quotes, and then you'll just have to do git push.
‫You don't have to add that.
‫You don't have to add that origin or anything like that or the branch name.
‫As long as you're pushing to the main branch, you just do git push.