1 00:00:11,850 --> 00:00:17,970 Welcome back and let's continue discussing GitHub and version control, so let's go briefly on what 2 00:00:17,970 --> 00:00:19,920 we have covered in the previous lecture. 3 00:00:20,220 --> 00:00:27,270 So first of all, we went over to GitHub, dotcom, and we have created we have went over the sign up 4 00:00:27,270 --> 00:00:28,020 process. 5 00:00:28,770 --> 00:00:32,040 Then we have downloaded the GitHub desktop app. 6 00:00:32,520 --> 00:00:39,960 And here we created a new repository by pointing out the project that we are working on from the beginning 7 00:00:39,960 --> 00:00:40,770 of the course. 8 00:00:40,770 --> 00:00:45,260 And then we pushed it to the cloud of GitHub, OK? 9 00:00:45,690 --> 00:00:50,270 And by that, we have created a repository in the cloud. 10 00:00:50,280 --> 00:00:51,030 Here it is. 11 00:00:52,470 --> 00:00:54,240 And now it is safe on the cloud. 12 00:00:55,080 --> 00:01:03,810 From this point, we went over to the GitHub desktop app and we've seen that any changes that we are 13 00:01:03,810 --> 00:01:05,240 making and by chance. 14 00:01:05,400 --> 00:01:05,940 All right. 15 00:01:06,270 --> 00:01:08,310 For example, ABC. 16 00:01:09,450 --> 00:01:17,720 It is reflected in GitHub desktop immediately, and then we can put some note, the comet, which comet 17 00:01:17,730 --> 00:01:25,050 means is on hold, the changes are on hold, and then once we commit, then this button turns into push. 18 00:01:25,050 --> 00:01:30,330 We can click on this button and it pushes the changes to the main branch. 19 00:01:30,880 --> 00:01:33,400 OK, this is what we have covered in the previous lecture. 20 00:01:34,650 --> 00:01:41,700 I've also mentioned briefly the branches topic, and I've said that we're going to elaborate on it later. 21 00:01:41,730 --> 00:01:43,950 OK, so later is now. 22 00:01:43,960 --> 00:01:46,680 And let's talk about branches and what are they? 23 00:01:47,880 --> 00:01:49,200 So what are branches? 24 00:01:49,680 --> 00:01:55,440 Let's first go over the slides and then I'll explain what we have just read and then you will see some 25 00:01:55,440 --> 00:01:56,430 live code example. 26 00:01:57,030 --> 00:02:03,660 So called branching enables software developers to work on different parts of the project without impacting 27 00:02:03,960 --> 00:02:05,910 impacting each other's work. 28 00:02:06,690 --> 00:02:15,780 Team can efficiently organize a on a efficiently organized work on shared code base on different branches, 29 00:02:15,900 --> 00:02:24,300 while while one is not interrupting the other, the main branch is the default branch, which the programmers 30 00:02:24,300 --> 00:02:28,690 mission is to keep him intact and earless at all times. 31 00:02:29,880 --> 00:02:36,810 Once we create a new branch, it will be a complete duplicate of the main branch and then we will apply 32 00:02:36,810 --> 00:02:38,100 changes on top of it. 33 00:02:39,040 --> 00:02:43,920 OK, so basically what we're going to do now is to create a new branch. 34 00:02:45,380 --> 00:02:45,890 All right. 35 00:02:47,340 --> 00:02:52,680 We're going to create a new branch and we're going to make changes on top of it and not on top of main 36 00:02:52,680 --> 00:02:53,190 branch. 37 00:02:53,230 --> 00:03:01,140 OK, that way developer AI could create his own branch while developer B. 38 00:03:04,510 --> 00:03:06,010 Could create his own ranch. 39 00:03:06,730 --> 00:03:14,080 They both can work on their personal branches without interrupting each other while committing and pushing 40 00:03:14,080 --> 00:03:15,310 to their own branch. 41 00:03:16,160 --> 00:03:24,190 OK, so I'm Developer A. And there is a second developer, developer B, I'm creating my own bridge 42 00:03:25,060 --> 00:03:27,760 while the second developer creates his own branch. 43 00:03:28,090 --> 00:03:34,060 And then we can each of what each one of us can work on the project without interrupting the other. 44 00:03:34,210 --> 00:03:41,470 Because imagine yourself that currently I'm working on Collection's dictionary basics and I'm changing 45 00:03:41,470 --> 00:03:45,700 this line line of authority and I've changed the line. 46 00:03:45,700 --> 00:03:48,280 And then I said commit and then push. 47 00:03:49,180 --> 00:03:53,280 And the other developer also made changes on this line line 30. 48 00:03:53,560 --> 00:04:00,520 So we would have many problems because we're both working on the same file simultaneously and pushing 49 00:04:00,520 --> 00:04:02,500 to the same branch, our changes. 50 00:04:02,740 --> 00:04:07,630 So basically, GitHub would go crazy and would not know what to do with it. 51 00:04:07,930 --> 00:04:13,990 But once we create, each of each of us creates his own branch, OK, which is a duplicate of the main 52 00:04:13,990 --> 00:04:14,500 branch. 53 00:04:14,530 --> 00:04:20,440 There is no such problems because each of each one of us works on his own branch, OK? 54 00:04:21,580 --> 00:04:28,030 And then once they are done, developer AI and developer B, once they are done committing and pushing 55 00:04:28,030 --> 00:04:32,500 through their own branches like the finish to making me making their changes. 56 00:04:35,600 --> 00:04:39,380 OK, their branch should be merged to the main branch. 57 00:04:39,460 --> 00:04:45,220 OK, so we're going to go over all of this flow right now in a few minutes. 58 00:04:45,270 --> 00:04:46,430 It sounds horrible. 59 00:04:46,460 --> 00:04:49,280 It sounds hard, but stay with me. 60 00:04:49,500 --> 00:04:51,380 I'm going to help you. 61 00:04:51,380 --> 00:04:55,240 And we're together, going to go over all of these steps. 62 00:04:55,250 --> 00:04:57,180 OK, I feel your pain. 63 00:04:57,500 --> 00:04:58,160 Don't worry. 64 00:04:58,160 --> 00:05:00,080 Everything's going to be all right. 65 00:05:02,420 --> 00:05:11,330 So we're going to leave this sketch here for a second and we'll go back to it at the end just to restudy 66 00:05:11,330 --> 00:05:13,020 what we're going to see right now. 67 00:05:13,340 --> 00:05:16,030 So, first of all, let's see a live goat example. 68 00:05:17,510 --> 00:05:23,350 So right now, we are in main branch and we're going to create a new branch, OK? 69 00:05:23,740 --> 00:05:28,040 We are only branch and we're going to create a new branch, OK? 70 00:05:31,820 --> 00:05:40,030 Clicking on this pass Central Park right here, then we have new branch and let's create Branch see, 71 00:05:40,370 --> 00:05:45,050 OK, I already created Branch in Branch B, so let's create Branch C. 72 00:05:46,500 --> 00:05:53,460 All right, now we have created Branchy, but still it's on our local machine and we need to push it 73 00:05:53,460 --> 00:05:54,060 to GitHub. 74 00:05:54,060 --> 00:05:56,030 So GitHub would also be familiar with it. 75 00:05:56,040 --> 00:05:58,040 The cloud would be familiar with our branch. 76 00:05:58,320 --> 00:05:59,370 So click on this. 77 00:06:03,820 --> 00:06:07,420 And now let's do some exploring. 78 00:06:07,450 --> 00:06:11,300 All right, we are on Branchy and let's make a small change. 79 00:06:11,390 --> 00:06:14,950 OK, let's add here, Brint. 80 00:06:17,370 --> 00:06:23,040 This line will appear at Branch C.. 81 00:06:24,000 --> 00:06:31,760 OK, I've made some changes, I'm on Branch C and I've seen I'm seeing this record right here. 82 00:06:32,070 --> 00:06:35,400 I've removed removed this line and added this line right here. 83 00:06:35,700 --> 00:06:37,230 I'm going to add a note here. 84 00:06:37,810 --> 00:06:41,570 I removed all print, added a new print. 85 00:06:41,580 --> 00:06:43,740 OK, this is the comment commit. 86 00:06:45,130 --> 00:06:49,320 Then it turned into Bush, pushing and pushing to where to branch. 87 00:06:51,330 --> 00:06:51,870 All right. 88 00:06:55,350 --> 00:07:04,480 And now let's have a quick look, we we discussed about GitHub desktop connected to both by charm and 89 00:07:04,480 --> 00:07:06,690 to GitHub dotcom, and let's test it. 90 00:07:06,810 --> 00:07:10,380 OK, let's put this word to the test. 91 00:07:10,650 --> 00:07:16,050 So right right now we're on Branch C and we've made this change the change here. 92 00:07:16,050 --> 00:07:20,120 We deleted the old print and added this line would appear on Branchy. 93 00:07:21,240 --> 00:07:28,710 Let's for a second switch to Main and see if this line stays here once we click Dumaine. 94 00:07:30,000 --> 00:07:32,310 All right, Buck, you've seen the change. 95 00:07:32,630 --> 00:07:40,050 OK, the old line that we have removed a here and the new line, the new changes does not appear here 96 00:07:40,050 --> 00:07:43,750 because these changes were not made on the main branch. 97 00:07:45,180 --> 00:07:51,450 We have created a new branch which indicates the line here, and the main branch does not see these 98 00:07:51,810 --> 00:07:52,860 latest changes. 99 00:07:52,980 --> 00:07:53,490 All right. 100 00:07:54,000 --> 00:07:57,720 And once we go again to Branch C, look at this line right here. 101 00:07:59,410 --> 00:08:03,650 But you see it returned to the new line we have added. 102 00:08:03,970 --> 00:08:09,430 Now let's go back let's go back to GitHub dot com to our repository. 103 00:08:09,790 --> 00:08:13,720 And currently we are working on collections, dictionary basics. 104 00:08:13,840 --> 00:08:15,590 And let's see the same thing right here. 105 00:08:15,940 --> 00:08:17,860 So collection dictionary basics. 106 00:08:18,260 --> 00:08:22,390 We are in our repository and I'm clicking on the file. 107 00:08:22,390 --> 00:08:23,050 We've changed. 108 00:08:24,220 --> 00:08:32,740 So in the main branch main, we're seeing here the last line print and I'll file once we are switching 109 00:08:32,740 --> 00:08:33,880 to Branch C. 110 00:08:36,350 --> 00:08:42,170 You can see that old line disappeared and we're seeing this line with a red branch, see? 111 00:08:42,650 --> 00:08:43,160 All right. 112 00:08:43,430 --> 00:08:46,920 So you can see the difference between these branches. 113 00:08:46,970 --> 00:08:52,250 OK, so we have created a new branch here and we've made some changes on it. 114 00:08:52,490 --> 00:08:59,050 But it's not the same as M. its main branch, main branch and this branch, see, are not the same. 115 00:08:59,060 --> 00:09:04,140 There are some changes in Branch C that do not appear on the map on the main branch. 116 00:09:04,880 --> 00:09:06,740 OK, this we already understand. 117 00:09:08,830 --> 00:09:17,820 Now, going back to our slide and we can see here, developer AI could create his own branch, OK? 118 00:09:17,920 --> 00:09:23,500 They both work on the own personal branches without interrupting each other while committing and pushing 119 00:09:23,500 --> 00:09:25,620 through the orb to their own branches. 120 00:09:26,680 --> 00:09:32,180 Once they are done and check their code, their branches should be merged to the main branch. 121 00:09:32,200 --> 00:09:38,170 So basically what we're going to do is, is to take these changes that we've made on Branch C and push 122 00:09:38,170 --> 00:09:41,620 them, basically merge them into the main branch. 123 00:09:41,620 --> 00:09:42,690 And how do we do it? 124 00:09:43,120 --> 00:09:49,660 We go to GitHub desktop, we click on the central part, we switch to the main branch, which is the 125 00:09:49,660 --> 00:09:50,200 default. 126 00:09:52,100 --> 00:09:57,710 And then we opened this part again, and right here at the bottom, we can see choose a branch to merge 127 00:09:57,710 --> 00:10:03,290 into Main, OK, we click on this part and here we choose Branch, see? 128 00:10:03,620 --> 00:10:07,880 And then you can see here merge Branch C into Main. 129 00:10:08,300 --> 00:10:12,800 OK, we're clicking on this part simultaneously. 130 00:10:12,800 --> 00:10:13,730 Simultaneously. 131 00:10:13,740 --> 00:10:17,320 Let me open pie chart because I want to see the changes happen here as well. 132 00:10:21,220 --> 00:10:22,270 It's too small. 133 00:10:23,390 --> 00:10:32,210 OK, we'll go back to that in a second, OK, so we choose to merge Branch into Maine and once we clicked 134 00:10:32,210 --> 00:10:34,300 it, we can see here, push Oregon. 135 00:10:34,610 --> 00:10:36,530 OK, so we need to push these changes. 136 00:10:44,240 --> 00:10:48,750 All right, we're done now let's look at beachum, remember? 137 00:10:48,770 --> 00:10:52,700 Currently, we are on the main branch and you can see. 138 00:10:54,110 --> 00:11:01,490 This line would appear at Branch C, appears in the main branch, while a few seconds ago it appeared 139 00:11:01,490 --> 00:11:08,560 only on Branch C, but now we have merged Branch C into Maine main OK. 140 00:11:08,870 --> 00:11:10,700 We basically took this branch. 141 00:11:10,700 --> 00:11:14,420 We open here and merged him back to the main. 142 00:11:15,290 --> 00:11:18,710 And this is how version control works. 143 00:11:19,310 --> 00:11:25,070 Basically, every developer can create his own branch and make his own changes. 144 00:11:26,030 --> 00:11:33,650 Then then once he commits and push these changes into his branch after checking his code, he can merge 145 00:11:33,650 --> 00:11:39,260 his branch back to the main branch, which is the default branch. 146 00:11:39,260 --> 00:11:42,320 And it will always be the most updated one, the main. 147 00:11:42,590 --> 00:11:48,680 OK, so all developers, like if you have 10 developers working on a single project, each and every 148 00:11:48,680 --> 00:11:52,250 one of them at the beginning of the year, they should create their own branches. 149 00:11:52,700 --> 00:11:58,670 For example, I'm working and Google and I'm working on developing this Google doc. 150 00:11:59,180 --> 00:12:03,950 And my mission for today is to create the Zoom feature. 151 00:12:04,100 --> 00:12:09,080 So I'm going to create a new branch in GitHub and call it Zoom feature. 152 00:12:09,920 --> 00:12:15,140 I'm going to develop lots of code, going to write lots of lines of code and develop these for that 153 00:12:15,140 --> 00:12:15,590 feature. 154 00:12:15,860 --> 00:12:24,380 And after I'm done, I'm going to merge the code that I've wrote into the main branch so everybody else 155 00:12:24,380 --> 00:12:25,520 would see my changes. 156 00:12:25,730 --> 00:12:32,240 OK, so basically all developers work on their own branches and once they are done, they merge, they 157 00:12:32,240 --> 00:12:33,900 branch into the main branch. 158 00:12:35,210 --> 00:12:40,070 I think this summer's the GitHub and version control pretty good. 159 00:12:40,340 --> 00:12:45,800 And now we can say surely that we have completed the GitHub. 160 00:12:45,800 --> 00:12:47,390 By the way, this is advanced. 161 00:12:48,740 --> 00:12:51,020 We have completed the version control topic. 162 00:12:51,260 --> 00:12:52,640 Thank you and bye.