Creating Feature Branch0:00
I'm currently on my master branch, but I need to make some important changes. So I'll check out a new feature, we'll call it changes, whatever it happens to be. And we'll open this in Sublime. And I'm going to go to my welcome page and scroll down. Now it has a color of red, a really big change, like I told you. So yeah, again, this represents some kind of feature you're working on. It could take a day, it could take a week or a month before this random feature is finished. So I will run git status, I'll add it, commit with a message of add some random X feature. And now I'm going to switch over to my staging server, because I'm ready to send this to the client or my team to ask everyone, are we good to go here?
Merging Into Staging0:41
And now I'm going to switch over to my staging server, because I'm ready to send this to the client or my team to ask everyone, are we good to go here? Can I push this live? Okay, so at the moment, the staging server does not reflect that important change. Let's merge it in. git merge feature changes. All right, so now it is reflected here, which means I will now push to GitHub, specifically to the staging branch, which will be automatic. And because we have quick deploy turned on through Laravel Forge, it should be reflected instantly.
Deploying Staging Updates1:08
And because we have quick deploy turned on through Laravel Forge, it should be reflected instantly. So I will close this, and you'll see I'm at staging.laravelscreencast.com, give it just a second. And if I click refresh, there we go. So now the staging version of our site reflects the changes, but not yet on the main site. So if I give that a refresh, it's still, of course, showing the master branch. So this is the point where you send a link on Trello, you ask your team to look over it, or you look over it and just make sure everything's good to go. Once it is, you now have to go ahead to merge it into, whoops, master, I always think of
Promoting to Production1:37
it, or you look over it and just make sure everything's good to go. Once it is, you now have to go ahead to merge it into, whoops, master, I always think of cars, switch back to the master branch and then merge in your staging changes and push it up. So now it's going to go to the master branch of GitHub. And again, we have quick deploy set up for our main Laravel Screencast website. So if I now come back and refresh, now our new feature is reflected on the main website. All right, very cool. So in the next episode, we'll talk about some gotchas you might run into when maintaining a staging website and your primary website on the same server.
