Difference between revisions of "Git checkout -b"

From wikieduonline
Jump to navigation Jump to search
Line 9: Line 9:
 
=== Create a new [[branch]] ===
 
=== Create a new [[branch]] ===
 
<code>[[git branch]] new_branch</code>
 
<code>[[git branch]] new_branch</code>
 +
 
<code>[[git checkout]] new_branch</code>
 
<code>[[git checkout]] new_branch</code>
  

Revision as of 08:32, 2 February 2023

Create a new branch and change to it:

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.

Create a new branch

git branch new_branch

git checkout new_branch

Related


See also

Advertising: