Exercise: Branches!

In this exercise, you will adding new features to your pet adoption website. You will be adding a gallery page, and if there is time, a contact page.

As you read through these steps, think about when would be a good time to commit. As you execute the steps, YOU get to decide when to commit.

1. Set up

  1. Switch back to your project folder with your pet adoption website.
  2. Use git status to double check to make sure you have no modified/uncommitted changes
  3. Use git branch to double check what branch you are on (it should be master!)

2. Gallery Page

  1. Create a new branch named gallery-feature and switch over to it
  2. Add a gallery.html. If you don't want to write a bunch of html and text, you can just copy the contents of this file: gallery.html
  3. Add some more images to your images folder. If you have time, create some image tags inside of gallery.html and include the images from the images folder.
  4. Anything else you can think of that would work well on a gallery page
  5. At this point you should have at least one or more commits on your gallery branch (use git log to double check!)
  6. When you have determined your feature done, merge your feature branch into master
  7. Once merged, make sure to delete your feature branch

3. Contact Page

  1. Create a new branch named and switch over to it contact-feature
  2. Add a contact.html. You can copy the contents of this page: contact.html
  3. Add anything else you think would make sense
  4. Once your feature is done (you should have at least one commit on this branch!), merge your feature branch into master
  5. Once merged, make sure to delete your feature branch

Don't forget to run git status regularly so that you can see what is happening at each stage!