Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
In this video, Nick and Jason discuss different branching strategies when developing application features and how to work together.
Branching: A branch contains a separate fork of code from a common ancestor in git. When a new git repository is created, there is a
master branch by default.
Feature Branch: A feature branch can contain code that isn't on a production site or development branch and contains a work in progress for a feature, such as design.
Merging: Merging a branch of code will copy that code
Deployable Branch: A git branch that is ready to go out to a given environment.
Staging Environment: A testing ground for features that may not be ready to go.
Smoke Testing Environment: The smoke testing environment contains a copy of the production database and new code that could be deployed to production.
Production Environment: The live, public facing code.
A popular git workflow that we're using in this project is based on creating a feature for the code we're about to write. Here's how it can work:
- Create a branch for our feature. In this case, we call it design.
- Work on the
designbranch while keeping the
masterbranch able to be deployed.
- Keep committing to our design branch until it is done.
- When we're happy with the
designbranch, we can merge that back to
masterbranch will then contain all of our code from the
When working with teammates on a Rails project it's important to have a system
that allows people to work independently of one another and
also integrate their changes.
In this project we're using the Git source control system to work together.
Git allows us to keep track of our changes to the code base as we add features to it.
If you're not familiar with Git, try taking a look at our
Git foundations course which is linked below the video here.
For the purposes of this project,
we're going to assume that you're familiar with some Git terms and have it installed.
If you're using the Treehouse VM.
It is already installed, and
just needs to be configured with your name and email address.
>> I've heard designers are hesitant to use GIT and especially the command line.
You might even be tempted to have your developer just do all of the work here.
>> And personally I refuse to do that for Nick.
>> Git is actually pretty easy.
You just need to get the hang of it.
>> As Nick and I are working together on this project,
we're going to be using a feature of Git called branching.
By default, when a Git depository is created the branch is called master.
The ODOT application was developed and currently exists on the master branch.
We can consider this the production ready branch of code
that is ready to be deployed at any time.
When we do big features such as adding design,
we can create a separate branch and work on that feature
in order to not impact any other changes happening at the same time.
>> We're going to call the branch that we're developing on, design.
making everything look good.
I can work together on this branch without affecting anything on the master branch.
If we want to add more features, we can always branch again.
Teams can work different ways when it comes to a Git branching workflow.
In some companies,
all development will be done on the master branch, which will always be ready to go.
>> And by ready to go, he means be able to be deployed out to production and
ready for users to take a look at.
This is the path that we'll be taking as we work through the features on this app.
It's worth it to be familiar with some
other workflows that are popular in software development.
Other popular workflows for teams are to have a production branch that is always
deployable, as well as branches for staging, smoke testing and more.
These are typically always deployable to their respective environments.
For example, a staging environment maybe a testing ground for
new features that aren't necessarily ready to go.
You can have your internal team,
test a new features in a staging environment and give them feedback.
>> The term smoketesting is a similar idea, but it's for later in the process.
A smoketesting environment, will typically connect with a live copy of production
data and will contain the code that is just about to be deployed.
This allows one to test the actual code against
actual data before it goes live to your millions of users.
>> Once we're comfortable with the feature development on our code and
ready to deploy it, we'll tag it with a name so
that we can always get back to it at a later time.
This is a lot to take in and we don't need to worry about all of this right now.
But these concepts are good to know for the future.
Now, with all of that in mind, let's get the apps set up and running and
get into our first branches.
You need to sign up for Treehouse in order to download course files.Sign up