 Hey everybody, and welcome to the 117th Qtutorial with C++ and GUI programming. Wow, we've done a lot of these. Alright, today we're going to be learning a little bit about what's called GitHub. I've got a project called Plugin Bot, and I know some of you are probably sick of seeing it, but let me back up. If you're interested in this tutorial or any others, please visit my website, www.voidrealms.com. You can find the source code in full videos. Alright, got that out of the way. My friends say I need to be a little more business-like and advertise, but I just like writing code. Anyways, Plugin Bot.net, I've put this into beta, and I've released some source code, and it's out on GitHub. So what is GitHub? Well, GitHub, let's actually go there. It's a collaborative source code site. It's a source code repository, or version control. Let's actually flip into Qt Creator, and you can see there is Git right here. And if you go to Options, I don't know if you've ever played around with Options, you'll see Version Control. And Qt Creator actually supports quite a bit of different version control platforms right out of the box. There's Bizarre, Clearcase, Git, Garrett, Mercurial, Subversion, Perforce, and CSV. And I think Git under the hood actually uses Subversion. But anyways, this is a GitHub tutorial. Well, I shouldn't call it a GitHub tutorial. A GitHub with Qt Creator in a creation tutorial. Anyways, I'll stop babbling. It's been a long day. Alright. So out on my site, I have some code. I shouldn't say my site, my GitHub repository. GitHub site, sorry. And inside, I have repositories. I have libraries where I can do encryption and compression and plugins, policies, a lamp server for PluginBot.net. We're going to focus on plugins here. So this is a repository, which, think of it just as a folder that you put other things into it. And you can see it's got a license and the profile and a quick little description. And it says these plugins are used to buy PluginBot.net. So the whole premise of PluginBot.net was that you can create plugins. Let's actually go back here. So if you go to plugins and you see this Telnet server, that's actually out here. That's this guy, Telnet server. So you can see an example. Well, we're not really going to play around with plugins. We're going to focus mainly on how to integrate with Git. So first thing we want to do is I have a folder called Git. Darn it, I just hit my elbow. I hate that. Sorry. We're going to clone this repository. And there's full documentation out there. I'm not going to do a full-blown GitHub tutorial. They've got tons of tutorials out there and it's just dirt easy. So we're going to clone that and we're going to clone the plugins repository. And you see that right here, PluginBot plugins. So we're going to Git is the application. Clone and then the URL. Now, you should note that if you're on, I think, Windows and Mac, there is a GUI version of this. But Linux, I don't think has a GUI version, so we got to do the command line. And it's pretty painless. And this is pretty much the only command line we're going to enter. And it's going to clone and it's going to say voila, done. But I actually put it in the wrong spot. So that's something you should be aware of. So let's actually CD into Git. Now let's try that command. Ah, boom. And there you see the folder appeared. Don't worry if you created it in the wrong spot, like I actually created it out in my home folder. Just don't worry about it because we're not going to worry about it. Just kidding. You can actually go out and remove it and it won't impact anything. I'll explain that in a bit. So we're going to open this up. And there's the source code, which we downloaded off the website. Now, if you've done any Qt projects before, you'll notice immediately right in the name, it's going to say master. What does that mean? Well, that means we're on the master branch. When you're working with repositories, you can branch and fork code off. So if you're making a DVD player and it supports one specific format, somebody else can take your code and fork it and then add in other things. And then they can request a merge and merge their code into yours. And it gets in this whole collaborative effort that's really, really cool. But for this tutorial, we're just going to discuss some very basics. So we're in here working with our code and we're just going to type away here. I'm going to say include the interface. And we're going to save that and we're going to modify this one too. So now we've changed some code and you should be where there's two different repositories. There's the local one you're working with and the remote one up here in the cloud, so to speak. I shouldn't say in the cloud on GitHub or whatever repository storage you're using. So go to tools, get and you can see all these options are suddenly lit up. Like you can do a diff, you can log, you can clean. I wouldn't recommend clean because that pretty much flushes everything that we just changed out of there. You have a local repository, which is your local file system and your remote repository, which is github.com in this case. Then you've got various tools which we won't really get into here. So we're going to go to local and we're just going to say status. That's the status of this thing. And you can see how we have modified two files, the two profiles. Pretty neat, huh? It says on branch master, so we're on the master branch of the source code. Your branch is up to date with the original master. Changes, not stage for commit. What does that mean? After we've made our changes, we have to commit them to our local repository. It's like checking it in. So we're going to go back to the tools, get local repository and commit. Now, let me resize this a little bit here. There we go. You can see that author, email address, your email address is going to be different. We need to put in a description. What did we do? That way we know what we did. And then we're going to check all the files that we want to check in. You know, we could uncheck one of them if we weren't done editing it. And then we're going to commit them. And when we commit them, it's not like committing somebody to a mental institution. We're just committing them to the local repository. We're saying we're done modifying these. All right. Now that we've done that, we can go. And you can always check the status. And it says your branch is ahead of the original master by one commit. That means our local repository has newer files already committed. And it says nothing to commit, meaning we haven't changed anything locally. Working directory clean. Wow, I can't talk tonight. So now we want to push these changes up to get up. Let's actually just show here. Whoops. So let's open up this. There's the project file. Yeah, you can see it doesn't have that comment in there. And it doesn't have any revisions showing up here. So what we're going to do is we're going to go back in here. Go tools. Maybe I'm a little special today. I swear there we go tools remote. There's fetch, pull and push. Well, we're going to push. Pull means you pull things down. And yes, I was right. Actually it is built on Subversion. Anyways, we're going to push our changes, meaning the commit that we just did. We're going to push that up to get hub. We're going to push. And it's going to say username. Now if it says get right here instead of HTTPS, you need to go in and modify something. So let's cancel. I'm going to show you where to do that. You're going to go options, version control. I swear it was right here. Maybe I'm just smoking some funky stuff today. I swear you had to enter it here. All right. Well, if you get an error and it says get, then change it to HTTPS. So anyways, we're going to go to get remote repository and we're going to push our changes. Oh, there it is. Manage remotes. Ah, yes. So if the origin is get, then you're going to need an SSH certificate. Since I don't really feel my project is totally top secret, I'm just going to use HTTPS or SSL. So anyway, back to where we were. Sorry, I'm so scattered brand today. It's been a long, long day. We're going to go to get remote repository. We're going to push our changes out. First thing it's going to do is say, what's your username? Why it's doing the password protection and looking stuff. I don't know. But then it's going to ask for your password. Now, I think that you can pre-cache those. So it says the command user bend get finished successfully. And there is our commit change. And we went from master to master, meaning we went from local to remote. So if we jump back out to GitHub here and we just refresh this page, you can see, there's the comment that we entered. Pretty neat, huh? And you can actually see a history. We can see added comments. I moved the interface. I've done some other things. And you can actually see the changes, you know, the before and after. You see this is original. It was just there and then boom. I'm sorry. No, this was the original. And that's the new version. Jeez, losing it today. And you can see the commit number. This is really handy. So if you are working in a team of developers and you get, you know, that special guy who thinks he can rewrite the wheel, you can undo his changes. And you can set up organizations and all sorts of stuff in GitHub so that you can do all sorts of stuff and you can actually make teams of developers. So that's it for this tutorial. No real source code here, but I wanted you guys to be aware that I am still out there. I'm still reading your emails. This was actually a viewer request. I think her name was Cynthia. If you're out there, hello. Please visit my website, voidrums.com. You can get the source code and everything else. I think I've talked about that. So I'll quit badgering. Anyways, hope you found this educational entertaining and thank you for watching.