您无法使用此命令创建新分支git checkout --track origin/branch如果您有未上演的更改。这是一个例子:$ git statusOn branch masterYour branch is up to date with 'origin/master'.Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: src/App.jsno changes added to commit (use "git add" and/or "git commit -a")// TRY TO CREATE:$ git checkout --track origin/new-branchfatal: 'origin/new-branch' is not a commit and a branch 'new-branch' cannot be created from it但是,您可以使用git checkout -b命令轻松创建具有未分阶段更改的新分支:$ git checkout -b new-branchSwitched to a new branch 'new-branch'M src/App.js