 In episode 1.8 I'm going to be teaching you guys how to keep your projects safe via GitHub desktop. Hello guys, it's Crypto Grounds here. Welcome back to another Unity Auto Game tutorial video. This is episode 1.9 where today we're going to be messing with GitHub and this is the 2021 edition. If you guys enjoyed this video, make sure you smash like button to show us the support. Consider subscribing if you're new and turn on notifications for future videos and live streams. Anyways, let's get on with it. So in the past, I've lost projects just for me not being smart and backing stuff up. And I've also made some pretty, pretty major mistakes in my games sometimes. And it's really hard to backtrack. So GitHub is a pretty good example of a version control software where you basically you can just keep track of all the changes you've made and backtrack if you need to. And also keep tracks of every single line of code you've changed and anything files you've added, deleted, stuff like that. So let's head to Google. So in Google, we're just going to search up GitHub desktop. And the first thing you'll see is desktop.github.com. So click on the link and you'll see this download page. So before you install, you need to create a GitHub account first. So let's also go to github.com. So I already have an account. So this may look different for you. But you'll what you'll want to do is register for an account and it should be pretty easy. So now if you already have an account, if you've created one, hit this download for Windows button right here. And if you're on macOS, you can click on this macOS button here or made show up for macOS here already. All right. So click on it. And you should get the GitHub desktop setup. So once you open it, you should see them the launcher running. And it pretty much just automatically installs for me. So if you see anything else in the installation process, just continue as is. And it should direct you towards the download process. But I've already had GitHub so it may look different for me. So it'll open up GitHub desktop. And it'll be empty. You won't see like a current repository. I can't really show you what that looks like. So in my case, I have a lot of repositories here. And I have a GitHub pro, which is like $4 a month, which I'd highly suggest you to get it. So you can create private repositories, so people can still your projects. However, if you want people to collaborate with you, you can send this project to a few people, you guys can collaborate to each other and stuff like that. However, if you want this to be open source, you don't have to do that. So I'm going to create a repository to save our project in. So just click that on this add button here. And we're going to create new repository. And we're going to give this a name. So we already have a name for this folder here. So let's see what is it called right here. It's called idle game tutorial series 2021. So I'm going to go back to GitHub here. I'm actually going to close out of this project. So I can rename it. Like I said, at the beginning of the series, you can change the name of the project. And I'm just going to call this idle game tutorial dash series dash 2021 repo. I'm just going to keep it consistent since that's what I name all my major repositories here. Oh, it looks like I need to close my editor here, my ID, let's make sure you do that. Okay. And once it's closed, try again, and it should rename the project. So what we're going to do here, I'm actually going to copy this name here. And in the repository name, I'm going to type it as is like this. And you can leave the description blank. And the local path is this. So basically, it's going to create a repository inside of this folder, which will make things kind of easier to manage. And we're going to set our get ignore to none because I'm going to provide a custom get ignore in the description below. And we're going to set our license as none. And before you click on this create repository button, backup this folder just in case anything goes wrong. So just simply select this folder, copy and paste it. So control C, control V, just copy and paste it just in case anything goes wrong. And it's also good just to create an even additional backup just in case you do anything super risky. Okay, so we have created our backup folder here. Now we can create the repository. Okay, cool. So this is a new feature, I guess, in the latest update is that you could initialize LFS, which is large file size. So basically, they don't accept files over I think it's 100 megabytes. And it would cost some issues if you were to publish your changes with a large file. So we're going to initialize this get with an LFS. And that will just prevent some issues. If you don't see that pop up, just don't worry about it. And just be sure you don't have 100 megabyte files are above in your project. Okay, cool. So now we go to our repository, which should be here in the other section. And this is called our repository name here. And you can see we have a ton of changes. This is basically all of the files we have currently. Let's go to our project right here. And you could see that we have now a dot get hidden folder. If you don't have hidden folders enabled, you won't see this. And you'll see a dot get attributes, you can get rid of this. Okay, so now for the dot get ignore file, which is in the description below, you're going to want to copy all the text in the link that you opened. And you want to create a file, a text file called dot get ignore. So this is basically a dot get ignore dot txt. And it should look something like this. Cool. This will basically just not pass through all the unnecessary files. So now remember that 8000 changes we had, this should severely decrease. Oh, it looks like you're already okay, never mind then. But basically, now this should have reduced from like 8000 to something like 1000. And now actually, since it has a bunch of library files in here, I'm just going to delete this library folder in here, just so we don't have a ton of clutter. And this is perfectly safe to do this basically just regenerates every time you open your project. So then you can get rid of library logs. And it should be fine. There you go. So see, we're going to lose a lot of changes here. And I'm just going to do remove library as title. So now when you make an initial change, just give it a title. So for me, I'm just going to call this like, you just call it like a knit for initialize or for me, since it already did it for me initial commit, I'm just going to put in remove library folder. Okay, and then hit this blue button called commit to main, and it's going to load, it'll process a little bit. And now you can finally hit that publish repository button. Let's hit that. And for me, I'm going to keep this code private, because I don't want anybody to look at it and take it from me. All right, so hit that publish repository button. And this should take some time. Okay, so now this is done. And now whenever you make a change in here, here, let's actually just do this just for an example. I'm just going to create a random text file in here. Okay, and now what you do here is that you can just just give it a title here, commit to main. And now here it's going to say push origin. So now this is basically you are pushing your changes to GitHub. And basically if you log in download GitHub on a different computer, you can receive what you pushed or receive the changes from GitHub. So basically, like in here, for example, it just fetch origin. So that's fetch basically you're fetching the new changes. And you will apply them to your local computer, like your local project, your local folder. Okay, so now we're just going to push origin here. And you want to be careful with pushing and fetching is because if you were to push and another client pushes, but you both don't fetch, you will have a situation where you basically push something and you fetch something. And that can just that can just cause some conflicts. And if you have a few change files here, and you were fetching something, you could potentially get into an issue where you are merging stuff. Now this is causes a lot of issues. So you just want to pay attention to that. If you ever run into that problem, just use Google Google as your friend. And you'll find some way to kind of minimize the damage that could be done with this. And one way is by simply backing up your folder, like what we just did where we just copied and pasted this entire folder. And then getting rid of all these changes here. And then fetching. So here, what I'm going to show you is how to get rid of a change here. So if we were to delete this text document here, let's delete it. What we can do here is discard changes here. If we discard the changes here, we're going to get this file back like that. Cool. So I'm actually going to delete this because I don't want this random text file in my project. Awesome. So I would recommend you to push to GitHub every update or every session, however often you'd like. And also it stores every single change in history. So you can see my crypto clickers. It goes all the way back to 2019, which I initialize this commit here. And you can see all my changes are stored here, which is very, very cool. You can see you can just go back to here. You can see all the changes I made during this commit. During I have very bad titles, by the way, to the 0.30 update, which is on 51920, you can see all the changes I've made here, which is pretty cool. All right, guys, I hope that all made sense. If you have any questions, make sure you let me know in the comments below, smash like button if you enjoyed this video and if you learned something new, and consider subscribing if you are new to the crew, turn on notifications so you get notified for future videos and live streams. Anyways, I'll catch you guys in the next one. I hope you guys have a great day night. Thank you guys for watching. I appreciate everyone's support. Peace.