1 00:00:00,090 --> 00:00:03,180 So I just spent all that time demonstrating, working on feature branches. 2 00:00:03,180 --> 00:00:11,460 But so far, none of the work that Colt me did or Stevie did, none of that work is integrated into 3 00:00:11,460 --> 00:00:13,740 the main branch or the master branch. 4 00:00:14,250 --> 00:00:19,860 So that obviously is an important part of working on feature branches, is integrating your changes 5 00:00:19,860 --> 00:00:23,430 in and we have a couple of options for how we do this. 6 00:00:23,670 --> 00:00:25,710 One would just be merge at will. 7 00:00:25,710 --> 00:00:31,920 Whenever anybody wants to merge their changes in, just go for it, just merge them into main. 8 00:00:32,100 --> 00:00:37,770 Obviously, that could be fraught with problems, especially on larger teams with lots and lots of collaborators, 9 00:00:37,770 --> 00:00:39,240 lots of new features. 10 00:00:39,240 --> 00:00:45,120 If there's no testing going on beforehand, if there's no conversation or discussion going on beforehand, 11 00:00:45,120 --> 00:00:46,860 that could get way out of control. 12 00:00:46,860 --> 00:00:54,300 And you would never do that on a real product with users and things at stake, maybe on a fun hobby 13 00:00:54,300 --> 00:00:55,860 project with friends, I guess. 14 00:00:55,860 --> 00:01:03,150 So another option that's similar is you merge your own branches in, but only after you have discussed 15 00:01:03,150 --> 00:01:03,270 it. 16 00:01:03,270 --> 00:01:10,560 You've sent an email or a chat message or some sort of had a conversation with your team in some way 17 00:01:10,560 --> 00:01:13,830 about whether you should merge those changes in or not. 18 00:01:13,830 --> 00:01:18,960 And then there is the third option, which is what we're going to talk about in the next video, something 19 00:01:18,960 --> 00:01:20,340 called pull requests. 20 00:01:20,340 --> 00:01:23,280 But first, I just want to do another demonstration of merging. 21 00:01:23,520 --> 00:01:26,040 So if you want to just get to pull requests, skip this video. 22 00:01:26,040 --> 00:01:33,390 But I'm just going to quickly demonstrate on Colt's computer, we have this pricing table branch, right? 23 00:01:33,390 --> 00:01:39,510 This is what the pricing table branch looks like, but the main branch currently doesn't have any of 24 00:01:39,510 --> 00:01:39,990 this. 25 00:01:39,990 --> 00:01:42,930 So let's say I've talked it over with Steve. 26 00:01:42,930 --> 00:01:44,400 We're just a two person team. 27 00:01:44,400 --> 00:01:46,290 Well, one person, one chicken team. 28 00:01:46,290 --> 00:01:49,560 And I say, okay, I'm ready to merge this in. 29 00:01:49,560 --> 00:01:54,390 I think let's say Stevie pulls it down, Stevie takes a look, we consent. 30 00:01:54,390 --> 00:01:55,410 All right, let's merge it in. 31 00:01:55,410 --> 00:01:56,700 Somebody merges it in. 32 00:01:56,700 --> 00:01:57,990 Let's say it's me. 33 00:01:58,470 --> 00:02:03,060 I'm the owner of the project, so I'm currently on the pricing table branch. 34 00:02:03,060 --> 00:02:10,110 I'm going to switch to master get switch are sorry to main old habits and then it's always good to just 35 00:02:10,110 --> 00:02:12,060 pull down to see if you've missed anything. 36 00:02:13,140 --> 00:02:15,330 Do we have any new work from Maine? 37 00:02:15,630 --> 00:02:16,860 No, we don't. 38 00:02:16,890 --> 00:02:24,180 Okay, so now I'm just going to merge and what does the branch I'm trying to merge in pricing table. 39 00:02:25,820 --> 00:02:27,560 And it looks like easy. 40 00:02:27,560 --> 00:02:28,360 Fast forward. 41 00:02:28,370 --> 00:02:33,280 So nothing bad, no commits or sorry, no conflicts, no merge, commit needed. 42 00:02:33,290 --> 00:02:37,220 Fast forward, merge and we see the pricing table shows up here. 43 00:02:37,250 --> 00:02:38,030 Great. 44 00:02:38,330 --> 00:02:40,380 I'll refresh my view here. 45 00:02:40,400 --> 00:02:42,710 I'm now on the main branch. 46 00:02:42,710 --> 00:02:45,320 We see the same thing as before OC. 47 00:02:45,380 --> 00:02:52,700 So we just integrated that feature branch and now I can push Main back up to Origin Main. 48 00:02:52,700 --> 00:02:54,430 So I'm going to do exactly that. 49 00:02:54,440 --> 00:02:56,540 Get Push Origin. 50 00:02:57,450 --> 00:02:58,350 Main. 51 00:03:00,820 --> 00:03:02,260 And then we'll go to GitHub. 52 00:03:04,270 --> 00:03:09,550 And now main includes the code from No, I'm on the wrong branch. 53 00:03:09,580 --> 00:03:12,090 Maine includes the code from pricing table. 54 00:03:12,100 --> 00:03:17,150 We see whatever work I had done, it's now on this branch, so nothing new. 55 00:03:17,170 --> 00:03:21,310 We just merged and then on Steve's side of things, wherever he lives. 56 00:03:21,610 --> 00:03:26,050 The next step for him would be to make sure to get that new version of the main branch. 57 00:03:26,050 --> 00:03:30,780 Whenever he goes back to Maine or whenever he needs that new work, go back to Maine branch. 58 00:03:30,790 --> 00:03:32,930 So get switch Maine. 59 00:03:32,950 --> 00:03:37,120 He could fetch or he could just pull, get, pull origin. 60 00:03:37,120 --> 00:03:37,900 Maine. 61 00:03:39,240 --> 00:03:43,080 And now Steve has this new work on his main branch. 62 00:03:43,500 --> 00:03:46,320 He has the whole pricing table and all of that stuff. 63 00:03:46,680 --> 00:03:49,410 And then he could merge in his nap bar branch. 64 00:03:49,410 --> 00:03:55,740 If they if we both agree it's appropriate he could merge in nap bar into main and then push that up 65 00:03:55,740 --> 00:03:59,930 and then Colt would then go pull that down and we would repeat over and over. 66 00:03:59,940 --> 00:04:03,360 So that's just a quick version of merging a feature branch in. 67 00:04:03,720 --> 00:04:08,910 It would be best to delete that branch locally if we agree that it's we're good to go. 68 00:04:08,940 --> 00:04:10,320 We merged in pricing table. 69 00:04:10,320 --> 00:04:11,790 We don't need that branch anymore. 70 00:04:11,820 --> 00:04:13,650 Delete it, delete it off of GitHub. 71 00:04:13,890 --> 00:04:18,750 But just to keep things short and easy for you to follow, if you do take a look at this repository, 72 00:04:18,750 --> 00:04:21,810 I'm not going to delete that branch this way. 73 00:04:21,810 --> 00:04:23,160 You'll just have that history. 74 00:04:23,160 --> 00:04:29,700 And in the next video, we're going to talk about the more common way of merging feature branches in 75 00:04:29,700 --> 00:04:33,780 or requesting to merge them in, which is a pull request.