Git 如何在提交到master之前创建分支

Git 如何在提交到master之前创建分支,git,Git,考虑到我可能不想在一个全新的项目中向主分支提交任何内容,我如何在向主分支提交任何内容之前创建一个功能分支 Actually it is possible, but not with the command : git branch <my-branch> But you can with : git init git checkout -b some-feature 实际上这是可能的,但不是通过命令:git branch 但你可以: $ git init Initialized

考虑到我可能不想在一个全新的项目中向主分支提交任何内容,我如何在向主分支提交任何内容之前创建一个功能分支

Actually it is possible, but not with the command : 
git branch <my-branch>

But you can with :

git init
git checkout -b some-feature

实际上这是可能的,但不是通过命令:
git branch

但你可以:

$ git init
Initialized empty Git repository in /home/pat/foo/.git/
$ git checkout -b foobar
Switched to a new branch 'foobar'
git checkout-b将创建一个分支并自动切换到它