Menu

Organize your Development Workflow with Git

Use this workflow in your mobile site development.

Git is an open-source tool that allows you to control different versions of components in your project. Use Git to work on new features of your mobile site in branches. Test those branches for functionality before you merge them into the master version of your project.

This workflow document outlines how.


1. Develop a new Feature in a Git Branch off the Master Base

To develop new features in your project, create a new feature branch in Git. The new branch is created from the master base by default.

Checkout a new feature branch off master.

1. Open a new Terminal (Mac) or Command Prompt (Windows).

2. To change to your local Git project repository, enter the following command on the command line:

cd path/to/github/directory

3. To create a new Git branch off master, enter the following commands on the command line:

git checkout master
git checkout -b featureBranchName1

For a complete tutorial on Git branches, see the Using Branches tutorial from the Getting Git Right documentation set.

4. To commit the work in this feature branch, frequently enter the following commands on the command line:

git add -A
git commit -m "your commit message"

5. As you work, ensure that there are no linting errors:

grunt lint

When you finish development, your QA tests the branch.

2. Test the Branch

Test the new feature. Preview your local server on test devices.

Previewing Follow the tutorials Preview a Local Adaptive.js Site on a Device or Preview a Local Server on your Computer to start to preview.

3. Develop a Second Feature in a Git Branch off Master

Create a second feature branch off master.

checkout a new second feature branch off master

1. To check which branch you are currently on, enter the following command on the command line:

git branch

2. Examine the output for the currently checked out branch. If your current branch is not master, continue to the next step.

3. To change to the master branch it Git, enter the following command on the command line:

git checkout master

Best Practice Keep distinct feature development separate even as you develop multiple project features in parallel.

4. To create a second feature branch in Git, enter the following command on the command line:

git checkout -b featureBranchName2

4. Test the Second Feature Branch

Test the second feature branch with the same procedure as for the first branch.

5. Merge the First and Second Feature Branches into a Release Branch

Once both features pass QA, merge the two branches into a single release branch. This release branch is a new branch off master.

The branch successively merges the changes from the first branch and the second branch.

git merge The Git merge command uses the current branch as the branch into which changes from another branch are merged into. Read about the Git merge command in the official Git merge documentation page.

Create a release branch off master.

checkout a new feature release branch off master

1. To check which branch you are currently on, enter the following command on the command line:

git branch

2. Examine the output for the currently checked out branch. If your current branch is not master, continue with the next step. If you are already on the master branch, skip ahead to create the release branch.

git checkout master

3. To change to the master branch it Git, enter the following command on the command line:

git checkout master

Best Practice Keep distinct feature development separate even as you develop multiple project features in parallel.

4. To create the release branch in Git, enter the following command on the command line:

git checkout -b releaseBranchName

You are now in the release branch. Now, merge the first feature branch into the release branch.

merge the first branch into the feature release branch

5. To merge the featureBranchName1 branch into the current branch, enter the following command on the command line:

git merge featureBranchName1

Now, merge the second feature branch into the feature release branch.

merge the second branch into the feature release branch

6. To merge the featureBranchName2 second feature branch into the current release branch, enter the following command on the command line:

git merge featureBranchName2

Your release branch now has all of the commits of the first and second feature branch.

7. If you are done with the first and second feature branches, delete them with the commands:

git branch -d featureBranchName1
git branch -d featureBranchName2

Test the release branch to ensure that the merge steps did not introduce problems. Use the same test procedures as for the individual branches.

When you are ready, merge the release branch into master.

merge the feature release branch into master

8. To go back to the master branch, enter the following command on the command line:

git checkout master

9. To merge the releaseBranchName release branch into the master branch that is currently checked out, enter the following command on the command line:

git merge releaseBranchName

6. Create a Bundle

After the new feature test, create a new Mobify bundle from the feature release branch.

Create a New Bundle Follow the steps in the Create a New Bundle tutorial.

7. Test the Bundle

Preview the bundle on various devices to test the bundle. Follow the previewing tutorials as before.

8. Publish the Bundle

Publish the bundle to deploy to your site visitors.

Publishing Work through the Publish a Bundle tutorial to display your mobile site.

9. Smoketest the Bundle

Regress the changes after they go live.

10. Merge to Master

Ensure that the master branch is in sync with the newly published bundle.

git checkout master
git merge releaseBranchName
git push

Delete the release branch, to keep the repository clean.

git branch -d releaseBranchName
Edit in GitHub