1 00:00:00,150 --> 00:00:03,530 The last thing we'll talk about here is in 2020. 2 00:00:03,540 --> 00:00:04,750 I've mentioned this a few times. 3 00:00:04,770 --> 00:00:09,960 GitHub decided to rename the default branch from master to Main. 4 00:00:10,110 --> 00:00:14,040 Now we've seen that that doesn't really impact us, right? 5 00:00:14,040 --> 00:00:18,600 We've been able to just push up a master branch and it's defaulting here to showing us master. 6 00:00:18,600 --> 00:00:21,820 If I just go to this repo, we see master. 7 00:00:21,840 --> 00:00:23,940 However, I do want to talk about it. 8 00:00:23,940 --> 00:00:26,850 If we make a brand new repository, we'll just call this. 9 00:00:27,600 --> 00:00:28,720 How about colors? 10 00:00:28,740 --> 00:00:31,410 All right, here's our repo called colors. 11 00:00:31,410 --> 00:00:32,549 There it is, colors. 12 00:00:32,549 --> 00:00:38,670 And I'm going to create this repository, and maybe this time I'm going to initialize it with something. 13 00:00:38,670 --> 00:00:40,560 So we'll learn about read meets. 14 00:00:40,560 --> 00:00:45,180 But I'm just going to click this box and notice it tells me something different now, right? 15 00:00:45,180 --> 00:00:48,720 It says this will set main as the default branch if I get rid of that. 16 00:00:48,990 --> 00:00:53,060 It doesn't say anything about Main because there is no branch. 17 00:00:53,070 --> 00:00:59,130 So when I create this repo as is with no read me just completely empty. 18 00:00:59,130 --> 00:01:01,650 There is no branch that is initialized. 19 00:01:01,650 --> 00:01:09,570 But as soon as I add a file to GitHub when I'm initializing this repository is what I mean, it automatically 20 00:01:09,570 --> 00:01:11,030 needs to have a branch, right? 21 00:01:11,040 --> 00:01:16,590 You can't have files in a git repo that are tracked and committed if they're not associated with some 22 00:01:16,590 --> 00:01:17,100 branch. 23 00:01:17,100 --> 00:01:20,040 So it defaults that branch name to main. 24 00:01:20,040 --> 00:01:24,090 So we could change that in our settings so that it always defaults to master. 25 00:01:24,090 --> 00:01:30,750 But you know, more and more people are using main anyway and that's kind of the push that GitHub is 26 00:01:30,750 --> 00:01:31,770 working towards here. 27 00:01:31,770 --> 00:01:38,430 So if we do this, I create this repository now it has a file in it, it has a commit initial commit 28 00:01:38,430 --> 00:01:39,620 that was made for me, right? 29 00:01:39,630 --> 00:01:43,290 I didn't say commit dash M or anything like that. 30 00:01:43,290 --> 00:01:48,630 It just made me this read me file, which is something we'll learn more about in future sections. 31 00:01:48,630 --> 00:01:53,370 So for now it's just a file and I'm on the main branch. 32 00:01:53,970 --> 00:02:01,440 So in order to get this branch down to my machine, in order to work with it, I can clone this repository. 33 00:02:01,800 --> 00:02:07,080 So I'll copy that and then I'll go over here and make sure I'm not in a repo. 34 00:02:07,500 --> 00:02:09,360 Get clone that URL. 35 00:02:11,220 --> 00:02:13,670 And then we have this colors repo, right? 36 00:02:13,680 --> 00:02:16,590 And if you look at the branch, we're currently on its main. 37 00:02:16,830 --> 00:02:18,210 So this makes it easy. 38 00:02:18,210 --> 00:02:22,320 If we want to work on the main branch, we just clone it and we have the main branch. 39 00:02:22,320 --> 00:02:29,250 But something that you may encounter is some companies or some projects may want to rename their branch 40 00:02:29,250 --> 00:02:33,450 from master to Main to be in accordance with these. 41 00:02:33,450 --> 00:02:37,860 They're not rules by any means from GitHub, but this new decision by GitHub. 42 00:02:38,310 --> 00:02:44,100 So to do that, if you've been working on the master branch and you want to rename it to Main, it's 43 00:02:44,100 --> 00:02:49,740 just like renaming any other branch so you can actually see instructions if you make a new repository, 44 00:02:49,740 --> 00:02:55,230 I'm going to delete this, but if we make a new repository, it shows us, as we've talked about a couple 45 00:02:55,230 --> 00:02:57,360 of times, what to do right. 46 00:02:57,360 --> 00:03:03,000 It gives you instructions if you want to push an existing repository at a remote and then this line 47 00:03:03,000 --> 00:03:06,240 renames the branch are currently on to be main. 48 00:03:06,980 --> 00:03:09,200 Or here's another version of this. 49 00:03:09,200 --> 00:03:15,860 If you don't have a repository yet, make a new repo, get in it, add some stuff to it, commit rename 50 00:03:15,860 --> 00:03:19,250 the branch to main and then push your branch called Main up. 51 00:03:19,730 --> 00:03:21,890 So I'll do this with our chickens demo. 52 00:03:21,890 --> 00:03:29,330 I have this master branch, but if I want to rename it to main whoops is I need to go to that repository. 53 00:03:29,330 --> 00:03:31,700 Geez I can't type back out of here. 54 00:03:31,720 --> 00:03:33,110 Seed into chickens. 55 00:03:33,230 --> 00:03:33,560 Right. 56 00:03:33,560 --> 00:03:35,270 We have one branch which is master. 57 00:03:35,270 --> 00:03:42,470 If I do get branch dash uppercase m main that renames my branch to main. 58 00:03:43,010 --> 00:03:45,290 So now there is no master branch. 59 00:03:46,130 --> 00:03:46,610 Right. 60 00:03:46,610 --> 00:03:47,690 We just have main. 61 00:03:47,960 --> 00:03:54,560 Remember there is no significance to the master branch name itself or to the master branch period. 62 00:03:54,560 --> 00:04:01,070 It's just that you have to be working on a branch in git and by default the default branch name is master. 63 00:04:01,070 --> 00:04:06,410 If you're working on Git on your machine, but on GitHub, the default branch name if you clone a new 64 00:04:06,410 --> 00:04:12,560 repo that you have not created a branch on, but GitHub has made a branch it will default to main. 65 00:04:12,650 --> 00:04:13,940 So don't get worried. 66 00:04:13,940 --> 00:04:15,740 Don't freak out if you don't see master. 67 00:04:15,740 --> 00:04:15,950 Right. 68 00:04:15,950 --> 00:04:17,450 It's the exact same concept. 69 00:04:17,450 --> 00:04:18,649 It's just a branch. 70 00:04:18,649 --> 00:04:22,490 And GitHub made this decision recently to make main that default name. 71 00:04:22,790 --> 00:04:27,920 So now I could push this branch up get push origin main. 72 00:04:29,970 --> 00:04:31,770 And if we head over here. 73 00:04:31,770 --> 00:04:32,820 If I refresh. 74 00:04:33,850 --> 00:04:35,770 We still see the master branch, right? 75 00:04:35,770 --> 00:04:37,510 But now we see Maine. 76 00:04:37,930 --> 00:04:39,100 So there's Maine. 77 00:04:39,460 --> 00:04:43,120 You'll see, though, that master is considered the default branch here. 78 00:04:43,150 --> 00:04:46,030 That is because we pushed up Master first. 79 00:04:46,030 --> 00:04:47,380 There was no main branch. 80 00:04:47,380 --> 00:04:50,490 And so GitHub doesn't ignore a master branch. 81 00:04:50,500 --> 00:04:55,270 I can change with the default branches on this project, but really you probably would not have main 82 00:04:55,270 --> 00:04:57,220 in master in the same project. 83 00:04:57,640 --> 00:05:01,000 What you would have is either a brand new empty project. 84 00:05:01,000 --> 00:05:07,660 You clone it down and you start on the main branch, or you work on a project with your company or some, 85 00:05:07,930 --> 00:05:11,160 some team and they decide we're not going to use the term master anymore. 86 00:05:11,170 --> 00:05:15,450 We will rename to Main and then you can make Main the default. 87 00:05:15,460 --> 00:05:22,150 I believe you go into settings and then we have branches and then I can decide that the default branch 88 00:05:22,150 --> 00:05:23,860 is actually main. 89 00:05:27,300 --> 00:05:34,410 And so now I've updated my project so that it defaults to showing me Main when I visit my repository. 90 00:05:34,890 --> 00:05:39,270 So keep in mind through all of this, if you're confused, it's just a name. 91 00:05:39,270 --> 00:05:42,310 Master is just a name for Branch in main, it's just a name for a branch. 92 00:05:42,330 --> 00:05:47,370 The only complication comes if you have been working on one branch called Master and you change that 93 00:05:47,370 --> 00:05:47,970 name. 94 00:05:47,970 --> 00:05:52,470 If you change it locally, then you need to push up that new branch name to GitHub. 95 00:05:52,470 --> 00:05:56,820 And then if you care about what your default branch is on GitHub, you need to change that. 96 00:05:56,910 --> 00:06:00,030 But this is not some seismic shift. 97 00:06:00,030 --> 00:06:04,680 It's just a branch name that you can change and you'll likely see more and more people using main rather 98 00:06:04,680 --> 00:06:05,490 than master. 99 00:06:05,490 --> 00:06:10,200 Though master is still incredibly common and it's still the default branch name on Git.