May 2017
Beginner
552 pages
28h 47m
English
The checkout subcommand examines the .git folder on your system and restores the snapshot associated with the desired branch.
Note that you cannot change to an existing branch if you have uncommitted changes in your current workspace.
You can create a new branch when you have uncommitted changes in the current workspaces. To create a new branch, use git checkout's -b option:
$ git checkout -b MyBranchName
Switched to a new branch 'MyBranchName'
This defines your current working branch to be MyBranchName. It sets a pointer to match MyBranchName to the previous branch. As you add and commit changes, the pointer will diverge further from the initial branch.
When you've tested the code in your new branch, you can merge the ...