Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Creating a Project Pages Site

Luke Kennedy
Luke Kennedy
11,661 Points

git checkout -b gh-pages

What does the "-b" mean with this command?

1 Answer

Nicholas Pretorius
Nicholas Pretorius
18,683 Points

Hi Luke,

The -b in this context is shorthand which instructs Git to do the following in one command:

  • Create a new new branch with the specified name (gh-pages in your example)
  • Checkout the newly created branch with the specified name

It is functionally equivalent to running:

  • git branch gh-pages

And then running:

  • git checkout gh-pages

See a list of flags and descriptions here from the Git docs.

Hope this helps