So I just spent all that time demonstrating, working on feature branches.
But so far, none of the work that Colt me did or Stevie did, none of that work is integrated into
the main branch or the master branch.
So that obviously is an important part of working on feature branches, is integrating your changes
in and we have a couple of options for how we do this.
One would just be merge at will.
Whenever anybody wants to merge their changes in, just go for it, just merge them into main.
Obviously, that could be fraught with problems, especially on larger teams with lots and lots of collaborators,
lots of new features.
If there's no testing going on beforehand, if there's no conversation or discussion going on beforehand,
that could get way out of control.
And you would never do that on a real product with users and things at stake, maybe on a fun hobby
project with friends, I guess.
So another option that's similar is you merge your own branches in, but only after you have discussed
it.
You've sent an email or a chat message or some sort of had a conversation with your team in some way
about whether you should merge those changes in or not.
And then there is the third option, which is what we're going to talk about in the next video, something
called pull requests.
But first, I just want to do another demonstration of merging.
So if you want to just get to pull requests, skip this video.
But I'm just going to quickly demonstrate on Colt's computer, we have this pricing table branch, right?
This is what the pricing table branch looks like, but the main branch currently doesn't have any of
this.
So let's say I've talked it over with Steve.
We're just a two person team.
Well, one person, one chicken team.
And I say, okay, I'm ready to merge this in.
I think let's say Stevie pulls it down, Stevie takes a look, we consent.
All right, let's merge it in.
Somebody merges it in.
Let's say it's me.
I'm the owner of the project, so I'm currently on the pricing table branch.
I'm going to switch to master get switch are sorry to main old habits and then it's always good to just
pull down to see if you've missed anything.
Do we have any new work from Maine?
No, we don't.
Okay, so now I'm just going to merge and what does the branch I'm trying to merge in pricing table.
And it looks like easy.
Fast forward.
So nothing bad, no commits or sorry, no conflicts, no merge, commit needed.
Fast forward, merge and we see the pricing table shows up here.
Great.
I'll refresh my view here.
I'm now on the main branch.
We see the same thing as before OC.
So we just integrated that feature branch and now I can push Main back up to Origin Main.
So I'm going to do exactly that.
Get Push Origin.
Main.
And then we'll go to GitHub.
And now main includes the code from No, I'm on the wrong branch.
Maine includes the code from pricing table.
We see whatever work I had done, it's now on this branch, so nothing new.
We just merged and then on Steve's side of things, wherever he lives.
The next step for him would be to make sure to get that new version of the main branch.
Whenever he goes back to Maine or whenever he needs that new work, go back to Maine branch.
So get switch Maine.
He could fetch or he could just pull, get, pull origin.
Maine.
And now Steve has this new work on his main branch.
He has the whole pricing table and all of that stuff.
And then he could merge in his nap bar branch.
If they if we both agree it's appropriate he could merge in nap bar into main and then push that up
and then Colt would then go pull that down and we would repeat over and over.
So that's just a quick version of merging a feature branch in.
It would be best to delete that branch locally if we agree that it's we're good to go.
We merged in pricing table.
We don't need that branch anymore.
Delete it, delete it off of GitHub.
But just to keep things short and easy for you to follow, if you do take a look at this repository,
I'm not going to delete that branch this way.
You'll just have that history.
And in the next video, we're going to talk about the more common way of merging feature branches in
or requesting to merge them in, which is a pull request.