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!
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
Jaime Sandoval7,083 Points
Why use git checkout for the new feature branch when the git branch -b new_feature automatically switches it?
“git branch -b new_feature” should place him in the new_feature branch automatically. So why, after creating the branch with said command, is he in the master branch when he runs “git branch”to view the new_feature branch? He should be in it already.
The git checkout
command lets you navigate between the branches created by git branch.
command can be used to create a new branch.
Thegit branch` command's primary functions are to create, list, rename and delete branches. To operate further on the resulting branches the command is commonly used with other commands like git checkout.