1 00:00:00,180 --> 00:00:02,009 One other thing about Get Clone. 2 00:00:02,380 --> 00:00:08,070 Something that I do get asked frequently from beginners is Do I have permission to clone this stuff? 3 00:00:08,640 --> 00:00:09,450 The answer is yes. 4 00:00:09,450 --> 00:00:15,120 If you see it on GitHub, if you actually can see it, you have permission to clone it and do whatever 5 00:00:15,120 --> 00:00:16,079 you want with it. 6 00:00:16,470 --> 00:00:18,270 In terms of tweaking the code. 7 00:00:18,270 --> 00:00:23,760 And it doesn't mean you can turn around and resell it necessarily depending on how it's licensed, but 8 00:00:23,760 --> 00:00:27,360 you definitely are able to clone that repository to your machine. 9 00:00:27,630 --> 00:00:33,210 So anybody can clone if it's a public repository, and if it was private, it wouldn't be able to see 10 00:00:33,210 --> 00:00:33,780 it anyways. 11 00:00:33,780 --> 00:00:34,560 You wouldn't, right? 12 00:00:34,560 --> 00:00:37,730 You wouldn't know the URL, you wouldn't be able to go to it on GitHub. 13 00:00:37,740 --> 00:00:41,040 But if you can see it on GitHub, copy that URL, you can clone it. 14 00:00:41,040 --> 00:00:43,170 You don't need to be an owner or a contributor. 15 00:00:43,410 --> 00:00:46,620 However, you're not allowed to just push up your own changes. 16 00:00:46,620 --> 00:00:51,750 We haven't talked about pushing, but once we get there, you can't just push changes up to a repository 17 00:00:51,750 --> 00:00:53,070 that somebody else owns. 18 00:00:53,070 --> 00:00:58,770 There's a whole workflow for suggesting changes for becoming a contributor, but you can't just take 19 00:00:58,770 --> 00:01:03,110 over someone's repository, clone it, delete everything, and then push that up to GitHub. 20 00:01:03,120 --> 00:01:05,030 So that's very, very important to understand. 21 00:01:05,040 --> 00:01:07,710 If you see the repo on GitHub, you can clone it. 22 00:01:07,830 --> 00:01:13,260 Now, everything I've said has been cloning or everything I've demonstrated has been using Git clone 23 00:01:13,260 --> 00:01:14,880 with GitHub repositories. 24 00:01:14,880 --> 00:01:19,890 Because GitHub is so popular, it's the standard place to host git repositories. 25 00:01:19,890 --> 00:01:23,610 But remember that Git clone works with any hosted repository. 26 00:01:23,610 --> 00:01:29,670 In fact, if you go to the documentation the Git docs for get clone, there is no mention of GitHub 27 00:01:29,670 --> 00:01:30,780 anywhere on here. 28 00:01:30,960 --> 00:01:35,640 So even if that's where a lot of people are using it is to clone GitHub repos. 29 00:01:35,670 --> 00:01:37,470 That's just how people are using it. 30 00:01:37,470 --> 00:01:39,390 That is not the nature of the command. 31 00:01:39,390 --> 00:01:42,570 Instead, it works with any hosted repository. 32 00:01:42,570 --> 00:01:47,520 Whether that's something that you're serving yourself like maybe a company has their own internal server 33 00:01:47,640 --> 00:01:52,380 with a hosted repo, or maybe we're using something like GitLab. 34 00:01:52,380 --> 00:01:58,350 So I actually struggled to find something that was public that we could clone that was not from GitHub. 35 00:01:58,350 --> 00:01:59,670 But here's an example. 36 00:01:59,670 --> 00:02:01,410 This is a project on GitLab. 37 00:02:01,410 --> 00:02:03,060 It's just called Sample Project. 38 00:02:03,060 --> 00:02:06,870 It's really just for demonstrating how to clone something on GitLab. 39 00:02:07,170 --> 00:02:10,289 So you don't need to go through and follow along with this. 40 00:02:10,289 --> 00:02:12,090 But if you want to, I'll include the link. 41 00:02:12,090 --> 00:02:15,510 I'm just going to copy the URL and then I'm going to go to my terminal. 42 00:02:15,540 --> 00:02:19,830 If I can find it over here, I'm going to make sure I'm not in a repository. 43 00:02:19,830 --> 00:02:22,230 So I am back out now. 44 00:02:22,230 --> 00:02:27,060 I'm not and I run Git Clone and this time it's not a github URL. 45 00:02:27,060 --> 00:02:27,260 Right? 46 00:02:27,270 --> 00:02:28,560 This is entirely different. 47 00:02:29,290 --> 00:02:31,030 And it looks like it worked. 48 00:02:31,060 --> 00:02:33,320 I have a new folder called Sample Project. 49 00:02:33,340 --> 00:02:37,170 This is not exciting on the inside, but you can see I'm in a git repo. 50 00:02:37,180 --> 00:02:38,860 I'm on the master branch right now. 51 00:02:38,890 --> 00:02:41,280 Get status here's get log. 52 00:02:41,290 --> 00:02:43,210 There's four or so commits in there. 53 00:02:43,540 --> 00:02:49,030 All right, so just proof that git clone is not tied to GitHub, it's just a native git command. 54 00:02:49,060 --> 00:02:55,060 Most of the usage you'll see online is with GitHub, but it will clone any hosted repo.