One other thing about Get Clone.
Something that I do get asked frequently from beginners is Do I have permission to clone this stuff?
The answer is yes.
If you see it on GitHub, if you actually can see it, you have permission to clone it and do whatever
you want with it.
In terms of tweaking the code.
And it doesn't mean you can turn around and resell it necessarily depending on how it's licensed, but
you definitely are able to clone that repository to your machine.
So anybody can clone if it's a public repository, and if it was private, it wouldn't be able to see
it anyways.
You wouldn't, right?
You wouldn't know the URL, you wouldn't be able to go to it on GitHub.
But if you can see it on GitHub, copy that URL, you can clone it.
You don't need to be an owner or a contributor.
However, you're not allowed to just push up your own changes.
We haven't talked about pushing, but once we get there, you can't just push changes up to a repository
that somebody else owns.
There's a whole workflow for suggesting changes for becoming a contributor, but you can't just take
over someone's repository, clone it, delete everything, and then push that up to GitHub.
So that's very, very important to understand.
If you see the repo on GitHub, you can clone it.
Now, everything I've said has been cloning or everything I've demonstrated has been using Git clone
with GitHub repositories.
Because GitHub is so popular, it's the standard place to host git repositories.
But remember that Git clone works with any hosted repository.
In fact, if you go to the documentation the Git docs for get clone, there is no mention of GitHub
anywhere on here.
So even if that's where a lot of people are using it is to clone GitHub repos.
That's just how people are using it.
That is not the nature of the command.
Instead, it works with any hosted repository.
Whether that's something that you're serving yourself like maybe a company has their own internal server
with a hosted repo, or maybe we're using something like GitLab.
So I actually struggled to find something that was public that we could clone that was not from GitHub.
But here's an example.
This is a project on GitLab.
It's just called Sample Project.
It's really just for demonstrating how to clone something on GitLab.
So you don't need to go through and follow along with this.
But if you want to, I'll include the link.
I'm just going to copy the URL and then I'm going to go to my terminal.
If I can find it over here, I'm going to make sure I'm not in a repository.
So I am back out now.
I'm not and I run Git Clone and this time it's not a github URL.
Right?
This is entirely different.
And it looks like it worked.
I have a new folder called Sample Project.
This is not exciting on the inside, but you can see I'm in a git repo.
I'm on the master branch right now.
Get status here's get log.
There's four or so commits in there.
All right, so just proof that git clone is not tied to GitHub, it's just a native git command.
Most of the usage you'll see online is with GitHub, but it will clone any hosted repo.