Initialize Repo and Remote1:10
So if I switch to my terminal, and notice in this case, it looks a little bit different from usual, only because I'm using a guest account for this video. So let's say php artisan knew my app and install that. All right, and if we cd in, we do have git on this machine. So I will initialize git, add everything to the staging area, and commit with install Laravel. Okay, so if I do a git log, sure enough, we can see that first commit. Now let's figure out how to get that up on GitHub. We can see that we need to add a new remote, and we're going to call this origin, and we'll make that equal to this path right here to the git repo. All right, so let's grab that, git remote add origin.
Push to GitHub1:48
and we'll make that equal to this path right here to the Git repo. All right, so let's grab that, git remote add origin. Next, I know this can be a little confusing at first, but you'll get used to it pretty quickly. We are going to push to that remote with the name of origin, and specifically our master branch. Now, if you're ever curious about options like this, remember that you can always say git, the command, and then -h for help, and then you can inspect it further. So in this case, -u, this is the sort of thing that you usually only have to do once per project. It just sets the upstream. And basically, that means it just creates the association between
It just sets the upstream. And basically, that means it just creates the association between your current branch and the remote one, which we called origin. Anyways, mostly you can ignore that stuff for now. So let's run this command. Our username is liracast screencasts, and the password. All right, so let's come back and give that a refresh. And just like that, you've pushed to GitHub. So now anyone in the world can view this repository and even contribute to it. Now, the three key things to take a look at here are the issues,
Commit and Push Changes3:16
And again, remember, in this case, I don't have any styling set up because we have a guest install. Desktop, my app, let's open that up. And geez, I always forget how bad the default install of Sublime looks once you've customized it a bit. Let's change this to something as simple as main.scss. And maybe we also want CoffeeScript compilation. Okay, so we've made a change. I will switch back to iTerm, run a git status. Okay, git add that, and commit with setup build process.
I will switch back to iTerm, run git status. Okay, git add that, and commit with setup build process. Okay, now this time, we only need to run git push. Push up to the default, which is origin. If I now switch back, give this a refresh, there's our second commit. And now here's the cool thing. We can see directly within the browser exactly what changes you made. And this is why it's really great for open source projects. When you see someone make a change, whether it's a pull request, which means it's a request to modify the source code.
Review Pull Requests and Diffs4:11
When you see someone make a change, whether it's a pull request, which means it's a request to modify the source code. If I find a bug with the Laravel codebase, and I want to fix it, I can create a pull request that shows Taylor exactly what changes I've made. So in this case, pretty clearly, the red is what was changed, and the green is what it was changed to. Now, if we go back to our home area, you can see that we can switch between any branches that we've set up. If we find an issue ourselves, and we want to document that, or if somebody else is using our project, and they find an issue,
Creating and Writing Issues4:39
If we find an issue ourselves, and we want to document that, or if somebody else is using our project, and they find an issue, you can create an issue. It doesn't do anything. And actually, on that note, if you're creating issues for yourself, do whatever you want. But when you submit issues to other projects, be really specific about what the problem is. So often people say what essentially translates to, it doesn't work. And as I'm sure you can see, that doesn't really help anyone at all.
Cloning and New Commit4:57
So often people say what essentially translates to, it doesn't work. And as I'm sure you can see, that doesn't really help anyone at all. Be very specific about what steps they can do to reproduce your issue. Okay, but anyways, they've created an issue, and now anyone can contribute to that. Now, let's do this. I'm going to switch back to iTerm, and let's imagine maybe you're on a different computer, or you're somebody else entirely. I'll cd back, and let's say rm -rf that project.
or you're somebody else entirely. I'll cd back, and let's say rm -rf that project. Okay, now it doesn't exist anywhere on our machine. Okay, well, we go to the root project, and we can see right down here, we have the ability to clone it. We use the git clone command for that. Just think of that as, hey, I want to copy this repo to my local computer. So we paste in that URL. We run it. By default, it's going to use the name of the folder here.
We run it. By default, it's going to use the name of the folder here. And there we go. If I cd into Laravel project, we once again have that, and we can view the git log. So why don't we just create a file, hello world, and save that to new file.txt. Okay, so if I run a git status, we can see we added a new file. We'll add that to the staging area. Commit with add some file.
