Unlimited WordPress themes, graphics, videos & courses! Unlimited asset downloads! From $16.50/m
Lessons:28Length:1.7 hours
Speedy workflows with atom.io
  • Overview
  • Transcript

7.2 Git Clone

Using MPM and bower, you're able to quickly create a project. However, there's still a faster way. If we turn this project into a GitHub repo we'll be able to clone it down from GitHub. From there, that project will act as a boiler plate for any future projects. To set this up as a GitHub repo we're going to need a get ignore. We don't want to store our known modules or our bower components. From the command line we'll create the get ignore. Within get ignore, we don't want the known modules folder or the bower components. Using Git-Plus will initialize the repo. We'll track all of the files. And then we'll commit. Now in GitHub we'll create our repo, we'll call this repo, a simple node server. We'll grab the URL, we'll set the origin. Now we can push. Now our project is up in GitHub. You can copy this URL to our clipboard. Using the get command, we can bring this down locally. Since we already have this opened up in this project, we'll create a new one. Within the command line we could type get clone and paste in the URL. This will clone into a folder called simple node server, and now if we type in atom, we can pull it up from the console. Let's try to run this. We'll type node server, and we get an error letting us know we can't find express. We'll install it with MPN install, this will go through and install all of our dependencies so we can run. And setting the port on 30 30 will run the server. We see, Hello World, in the page. But we're getting a 4-4 error in the console. And the browser can't find jQuery. We need to go back to the console and do a bower install. We'll stop the server. Now, we'll type bower install. This goes and installs all of our client side dependencies. Now if we run the server again, we don't see the error in the console. After cloning this down from Git, we just needed to run an MPM install and a bower install, and we are able to get up and running. However, there are two things to take note of. We still had the name simple node server for the project, and we're initialized to the GitHub repo. If we're creating a new project, we'll probably want our own name, and our own repo. To remove the get repository, we need to type in rm- rf.git. And now not initialized to any Git Hub repo. If we wanted to initialize the repo, we could go through get plus or we could just type get in it. This process is now reuseable, but it's not optimal yet. We still have to run several commands to get it up and running. In the next lesson we'll learn all these individual steps and move them into one command. And we'll do this through batch scripting.

Back to the top