1 00:00:00,120 --> 00:00:05,160 I want to start this section on rebasing by telling you a little bit about my own personal history with 2 00:00:05,160 --> 00:00:06,000 rebasing. 3 00:00:06,600 --> 00:00:12,960 It's a command to get rebase is the command that there's a bit of a divide over in the community. 4 00:00:13,200 --> 00:00:15,670 Some people use this command all the time. 5 00:00:15,690 --> 00:00:19,090 Some companies ask that their developers use rebase all the time. 6 00:00:19,110 --> 00:00:21,260 Others avoid it like the plague. 7 00:00:21,270 --> 00:00:27,600 And when I first started, when I first learned Git, I was actually told by the person I was learning 8 00:00:27,600 --> 00:00:30,750 from to try to avoid rebasing ever. 9 00:00:30,780 --> 00:00:32,100 Don't worry about it. 10 00:00:32,100 --> 00:00:35,400 It can really screw things up for you and for other people on your team. 11 00:00:35,400 --> 00:00:41,940 It's not for beginners and some of that is true for sure, but it was kind of, I don't know, a scary 12 00:00:41,940 --> 00:00:46,500 command for me and I avoided it for quite a long time, for many years. 13 00:00:46,800 --> 00:00:48,300 And I got by just fine with Git. 14 00:00:48,300 --> 00:00:50,120 I didn't really run into many issues. 15 00:00:50,130 --> 00:00:55,590 Maybe there was once or twice I had to use it, but I would just google what I needed to do and find 16 00:00:55,590 --> 00:00:56,940 something on StackOverflow. 17 00:00:56,970 --> 00:00:59,670 It just wasn't something I needed to do frequently. 18 00:00:59,910 --> 00:01:05,280 Anyway, one day I was teaching a boot camp a couple of years ago and a student asked me about rebase 19 00:01:05,280 --> 00:01:09,990 and from the rest of the class and I was not all that prepared to give him a good response. 20 00:01:10,380 --> 00:01:14,670 So I went home, did my research, I came back, gave a lecture the next day. 21 00:01:14,670 --> 00:01:18,720 Anyway, it doesn't really matter, but long story short, I use rebase all the time. 22 00:01:18,720 --> 00:01:23,490 Now it can be very useful, but you have to know when not to use it. 23 00:01:23,490 --> 00:01:27,540 There's a golden rule of rebasing and we will focus on that in this section. 24 00:01:27,930 --> 00:01:34,890 So there is a divide within the community because rebasing is an alternative to merging. 25 00:01:34,890 --> 00:01:37,860 There's two different things really that people do with rebasing. 26 00:01:37,860 --> 00:01:42,030 And the first one is you can use git rebase instead of get merge. 27 00:01:42,030 --> 00:01:47,310 So some people like to do that and they'll use Git rebase or some companies will ask their developers 28 00:01:47,310 --> 00:01:49,620 to use Git rebase instead of merging. 29 00:01:49,620 --> 00:01:54,210 But other people get by just fine with git merge and they avoid get rebase. 30 00:01:54,210 --> 00:01:58,170 So there's two big workflows for combining branches. 31 00:01:58,170 --> 00:02:00,000 One is rebasing and one is merging. 32 00:02:00,000 --> 00:02:03,000 So we'll talk about that starting in the next video. 33 00:02:03,000 --> 00:02:10,259 And then the second use case for rebase is to clean up your own commits, clean up your your git history, 34 00:02:10,259 --> 00:02:12,240 and we'll talk about that, too, towards the end. 35 00:02:12,570 --> 00:02:13,170 All right. 36 00:02:13,170 --> 00:02:17,310 So you can get by with just merging things as we have been doing. 37 00:02:17,310 --> 00:02:22,290 Rebase is not, in my opinion, one of the essential commands that you just have to know. 38 00:02:22,890 --> 00:02:28,620 As I said, I used Git for quite a while without really rebasing all that much, but it's definitely 39 00:02:28,620 --> 00:02:29,730 worth knowing about. 40 00:02:29,730 --> 00:02:35,210 And these days I think it's gaining in popularity or at least equal to the git merge crowd. 41 00:02:35,520 --> 00:02:36,300 So let's begin.