- Now when you wanna play around with some Git repository,
or some of the files that I include in one of my courses,
you'll wanna make a copy of the respository
on your local hard drive,
and you can use the git clone command to do that.
So right now, I'm on my homepage of GitHub,
so it's github.com/planetoftheweb,
and I'm gonna click on Repositories,
and then look at this angular data project,
'cause it's the one that I want to clone.
So from here, you wanna make sure
you read this Read Me document,
to see if there's any prior installations
that you need to have done.
So this one requires node.js, git, and gulp.
I know that I already have those installed,
you can click on these links right here,
which will show you how to get those and install them.
Then after that, we're gonna need to clone the repository,
there's an instruction right here,
and switch over to that folder,
and run the npm install so that we can install
all the project dependencies.
So let's go ahead and do that,
I'm gonna go over here to this clone URL
and click on this Copy to clipboard button.
This is pretty much the same thing as this URL,
just with the .git extensions,
you can see that I selected everything
and I pasted what I had on the clipboard,
and it's just the same thing as the URL
with the .git extensions.
So I'm gonna open up my terminal,
on a PC this would be Git BASH,
and the first thing I wanna do is make sure
that I'm in the right folder.
So I think by default,
if you do a pwd for present working directory,
you'll notice that I'm in my Users folder.
I wanna put this on the Desktop,
so I'm gonna do a cd ~/Desktop
and in here I wanna run a git clone command,
and then paste that URL
and let Git go ahead and clone this project
into my Desktop.
So if we make this a little smaller,
you can see that here's the folder that we just cloned.
And if we open this up,
let's do it in my text editor,
you'll see that it pretty much matches everything
that is in this GitHub file structure.
Now we pretty much got everything that was on GitHub,
but this is not everything we need to run this project.
So as per the instructions,
we need to have installed some things beforehand,
and then we need to make sure we go to that directory.
So in my Terminal,
right now, you'll notice that I'm still on the Desktop.
I need to cd, or change directory,
to the angulardata folder,
now I'm in there.
Then I need to run the npm install command.
Now you may need to run this as the superuser,
depending on your permissions,
so if you get some errors,
just add sudo to the beginning of this.
And it looks like I didn't get any errors in this case,
but if you get some errors,
especially on a Mac,
you can do sudo npm install,
and that will perform all the installations.
And, after you do this,
then you can execute the gulp command,
this particular project uses gulp.js,
and that will allow you to take a look at this project.
So this has some automation built in,
and when I run gulp,
it's gonna run the automation
and start that project up on a browser.
So, we can login,
and we can play around with this project if we want to.
So this is an AngularJS project that I made,
and if you wanna learn more about it,
just go to the GitHub page
and click on this link right here
at the very top of the screen,
that will take you to the lynda.com site for the project,
which is this one right here.
You can find all my courses at lynda.com/Ray-Villalobos.
So if you need some instructions on
how to do some of the remaining installations,
you can take a look at this first chapter right here.
So what you'll notice is that now
I have a copy of this entire project,
and if I open up angulardata,
you'll notice that the node_modules folder
has been reconstituted.
This has all of the dependencies
that this project needs in order to run.
Those are all specified in this package.json file.
So if you open this up in Sublime Text,
you'll notice that this required
three different dependencies,
those have all been downloaded
into this node_modules folder.
As I said, you never include node_modules
with any GitHub project,
that's something that always used to throw me off,
I would always try to run the project
and not understand that the dependencies
needed to be downloaded.
So, another thing that you may wanna take a look at,
is the logs for this project.
So on a Mac OS X Terminal,
we can go ahead and open another pane,
or open a new tab,
so I can say hit Cmd T,
this will open up a new tab here.
So it's actually in the Shell menu,
you can select New Tab,
and this will put me in the same directory
that I'm currently in.
So while my automation is running on this tab,
on this other tab I can just go ahead
and execute any commands.
On a PC, you would wanna open up another copy of Git BASH.
And in here I can use any sort of git commands,
so if we do a git status,
you'll notice that everything is up to date.
We can do a git log,
and take a look at the logs that we used
when we were creating this project.
There should be quite a few of them,
and you can keep on going this way.
I'm gonna use Ctrl Z to get out of this.
And, if we want to, we can also,
let's go ahead and clear this out.
We can also execute a git branch command.
Now this is something sort of weird,
you'll notice that there's only one branch,
and if we go to the actual GitHub project...
you may have noticed that before,
we had a lot of branches right here.
So, in our local respository,
it doesn't look like it downloaded anything
other than the master branch.
That's not actually not entirely true,
all the information about the branches
have been downloaded,
however, we can't really see anything
other than the master branch,
it's the only one that we have access to.
We'll talk more about branches in the next video,
for the meantime I think this is plenty.
Cloning a GitHub repository is a great way
to get the latest version of a project.
It's always a good idea to read the Read Me document,
so that you can know what other installations
need to be performed,
before you start working with a project.
Let's go ahead and clean this up,
we're not gonna need this project anymore,
so I'm just gonna get rid of this file,
and my Terminal,
this will stop the automation from running,
and I'm just gonna get rid of this angulardata folder.
We'll start looking at branches in a new project,
in the next video.