The Challenge:

Create a new branch on your fork for your contribution.

Branches

Git repositories use branches to isolate work when needed. It's common practice when working on a project or with others on a project to create a branch to keep your changes in until they are ready. This way you can do your work while the main, commonly named 'master', branch stays stable. When your branch is ready, you merge it back into 'master'.

For a great visualization on how branches work in a project, see this GitHub Guide: guides.github.com/overviews/flow

GitHub Pages

GitHub will automatically serve and host static website files in branches named 'gh-pages'. Since the project you forked creates a website, its main branch is 'gh-pages' instead of 'master'. All sites like this can be found using this pattern for the URL:

http://githubusername.github.io/repositoryname

Step: Create a branch

When you create a branch, Git copies everything from the current branch you're on and places it in the branch you've requested.

Type git status to see what branch you're currently on (it should be 'gh-pages').

Create a branch and name it "add-<username>", where 'username' is your username. For instance, "add-jlord". Branches are case-sensitive so name your branch exactly the way your GitHub name appears.

$ git branch <BRANCHNAME>

Now you have a branch with a new name identical to 'gh-pages'.

To go into that branch and work on it, similar to using cd to change directory in terminal, you checkout a branch. Go onto your new branch:

$ git checkout <BRANCHNAME>

Step: Create a new file

Back to the text editor:

Step: Check-in

Go through the steps for checking in a project:

$ git status

$ git add <FILENAME>

$ git commit -m 'commit message'

Now push your update to your fork on GitHub:

$ git push origin <BRANCHNAME>

Verify with

git-it verify

Go to the next challenge

git-it

Tips