0

我的 git status 显示以下内容,我想创建一个新分支并将这些未提交的更改转移到该分支..我该怎么做?

<prompt>git status
# Not currently on any branch.
# 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:   DATA/code/inc/sirApi.h
#       modified:   DATA/code/src/pe/include/miloSession.h
#       modified:   DATA/code/src/pe/milo/miloProcessSmeReqMessages.c
#       modified:   DATA/SME/src/sac/sacApiRoam.c
#       modified:   DATA/SME/src/sac/sacInsideApi.h
4

2 回答 2

1

试试这个:

git checkout -b newbranch
git add [your files]
git commit -m'Your message'

如果要提交所有文件,可以运行

git checkout -b newbranch 
git commit -a -m'Your message'
于 2013-01-17T06:56:54.523 回答
0

采用

git checkout -b <new-branch> <start-point>

其中 new-branch 是您要创建的分支的名称,并将 sha1 指向您希望新分支开始的位置。既然你是分离的,我认为最好明确说明起点,这样你就可以确定你的分支从哪里开始。

于 2013-01-17T07:13:20.230 回答