Skip to content

Commit f107792

Browse files
committed
feat(tools): Adds command to create new branch and switch to at same time
1 parent 275cb4d commit f107792

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ Sometimes, the same lines in a file will have been changed by two different bran
122122

123123
When you don’t need a branch anymore, it can be deleted using `git branch -d <branch_name>` if the branch has already been merged into main, or with `git branch -D <branch_name>` if it hasn’t. You will usually want to delete branches when you’re done with them, otherwise they can pile up and make it more difficult to find the branch you’re looking for when you need it.
124124

125+
`git checkout -b <branch_name>` Create a new branch and immediately switch to new branch.
126+
`git switch -c <branch_name>` Git 2.23 version but previous command also works.
127+
125128
#### Sharing Code
126129
Another great use case for branches is to share code with others that you might not want to commit to your main branch (or feature branch) at all.
127130

0 commit comments

Comments
 (0)