Difference between revisions of "Git checkout -b"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
  
 
Create a new [[branch]]:
 
Create a new [[branch]]:
 +
 +
git branch new_branch
 +
git checkout new_branch
 +
 +
 +
 
  [[git checkout]] -b YOUR_NEW_BRANCH_NAME
 
  [[git checkout]] -b YOUR_NEW_BRANCH_NAME
 
  Switched to a new branch 'YOUR_NEW_BRANCH_NAME'
 
  Switched to a new branch 'YOUR_NEW_BRANCH_NAME'

Revision as of 17:55, 15 July 2022

Create a new branch:

git branch new_branch 
git checkout new_branch


git checkout -b YOUR_NEW_BRANCH_NAME
Switched to a new branch 'YOUR_NEW_BRANCH_NAME'
git checkout -b "Name with spaces"
fatal: 'Name with spaces' is not a valid branch name.


See also

Advertising: