1 00:00:00,150 --> 00:00:00,690 Okay. 2 00:00:00,690 --> 00:00:05,970 So we spend a lot of time talking about poll requests, but it's a very important feature and it's actually 3 00:00:05,970 --> 00:00:08,550 going to come up again in this next workflow. 4 00:00:08,550 --> 00:00:12,690 I'm going to introduce I'm calling it Fork in Clone or Forking and cloning. 5 00:00:12,810 --> 00:00:15,420 It's it's a different approach to what we've seen so far. 6 00:00:15,510 --> 00:00:21,870 So this is a workflow where instead of just one centralized repository on GitHub, every developer has 7 00:00:21,870 --> 00:00:26,640 their own GitHub repository in addition to some main centralized repo. 8 00:00:26,970 --> 00:00:32,220 And then individual developers can make changes and push to their own versions, their own forks before 9 00:00:32,220 --> 00:00:33,510 making pull requests. 10 00:00:33,510 --> 00:00:36,090 So I'm going to diagram all this and hopefully it makes sense. 11 00:00:36,690 --> 00:00:42,900 The the whole point of this is that large open source projects, projects with lots of contributors, 12 00:00:43,080 --> 00:00:49,440 maybe thousands and thousands of contributors, they often employ this strategy or this workflow where 13 00:00:49,440 --> 00:00:53,820 there might be a handful of actual maintainers and owners of the project. 14 00:00:53,820 --> 00:01:00,630 They're not adding thousands of people as direct contributors like we saw with an invite where I could 15 00:01:00,630 --> 00:01:01,860 invite Stevie. 16 00:01:01,890 --> 00:01:03,600 I manually went in here. 17 00:01:04,170 --> 00:01:05,129 Where was that? 18 00:01:05,129 --> 00:01:08,130 Manage Access and I invited Stevie. 19 00:01:08,130 --> 00:01:15,060 So they're not doing that for every single person who wants to collaborate on React or TensorFlow or 20 00:01:15,060 --> 00:01:15,690 something. 21 00:01:15,780 --> 00:01:23,040 Instead, this workflow, this fork and clone workflow enables anybody to try and make a contribution. 22 00:01:23,400 --> 00:01:24,630 You don't need permission. 23 00:01:24,630 --> 00:01:28,890 You make your own copy, you try making changes and then you make a PR. 24 00:01:28,890 --> 00:01:30,600 Anybody can make a pull request. 25 00:01:30,780 --> 00:01:33,570 So the first concept to understand is forking. 26 00:01:33,900 --> 00:01:38,670 Forking is a feature that is not part of git itself. 27 00:01:38,760 --> 00:01:44,820 Just like a PR is not part of Git, it is a feature of GitHub and other similar hosting services for 28 00:01:44,820 --> 00:01:45,720 Git repos. 29 00:01:46,440 --> 00:01:54,090 When we fork a repository, it creates a personal copy of somebody else's repository on our GitHub account. 30 00:01:54,090 --> 00:01:59,130 So we would call the new copy a fork of the original repository. 31 00:01:59,130 --> 00:02:04,740 So when I click the button to fork a repo, I'm asking GitHub to please make me a personal copy of this 32 00:02:04,740 --> 00:02:05,370 repo. 33 00:02:05,640 --> 00:02:08,520 This only works if it's a public repo and we have access to it. 34 00:02:08,520 --> 00:02:13,380 Or I guess if it's a private repo, you can fork it if needed, but you still need access to it. 35 00:02:13,380 --> 00:02:14,970 So I'll demonstrate this. 36 00:02:15,090 --> 00:02:18,660 I want to be clear again, this is not a git feature, it's part of GitHub. 37 00:02:18,840 --> 00:02:23,670 So on some repository this is for example, not my repository. 38 00:02:23,670 --> 00:02:26,430 Clearly automatic Udemy course enrol or get paid. 39 00:02:26,430 --> 00:02:27,840 Udemy course is for free. 40 00:02:28,140 --> 00:02:32,520 I don't even know if this is still up or not, but this is not my project. 41 00:02:32,520 --> 00:02:35,130 But if I want to work on it, I'm not a collaborator. 42 00:02:35,130 --> 00:02:39,360 Instead I'm going to click this fork button right there. 43 00:02:39,360 --> 00:02:44,400 So when I do that, notice what the URL or the what would you call this? 44 00:02:44,400 --> 00:02:48,720 I guess the breadcrumb is somebody's username slash the repository name. 45 00:02:49,140 --> 00:02:51,240 When I fork, I click that button. 46 00:02:51,240 --> 00:02:57,210 Now we have a copy that is on my account, Colt slash, Automattic, blah, blah blah. 47 00:02:57,480 --> 00:03:01,410 So I still have all the history, all the files, but I can do my own stuff on here. 48 00:03:01,410 --> 00:03:05,640 I can clone this, I can delete branches, I can completely break code. 49 00:03:05,640 --> 00:03:06,780 It's totally up to me. 50 00:03:06,780 --> 00:03:10,920 It's just my repo now and it's just based upon the original. 51 00:03:10,920 --> 00:03:15,180 So here's the two side by side, the original, and then my fork. 52 00:03:15,210 --> 00:03:18,960 It shows my username, but also it says where I forked it from. 53 00:03:18,960 --> 00:03:21,570 And that's just an intro to the concept of forking. 54 00:03:21,570 --> 00:03:22,440 In the next video. 55 00:03:22,440 --> 00:03:28,050 I'll demonstrate it and then we'll talk about how we can use this concept to make open source contributions.