Git 使用现有更改创建新分支
我克隆了存储库的一个主分支,并做了一些更改。如何使用这些更改创建分支?我不想把它们推给master。以备将来参考。通常情况下,在进行任何更改之前,您会进行分支。但供将来参考Git 使用现有更改创建新分支,git,Git,我克隆了存储库的一个主分支,并做了一些更改。如何使用这些更改创建分支?我不想把它们推给master。以备将来参考。通常情况下,在进行任何更改之前,您会进行分支。但供将来参考 git stash save git stash branch <branchname> git隐藏保存 吉特储藏处 如果您尚未提交: $ git checkout -b <new_branch_name> # create (and checkout) the new branch $ git
git stash save
git stash branch <branchname>
git隐藏保存
吉特储藏处
如果您尚未提交:
$ git checkout -b <new_branch_name> # create (and checkout) the new branch
$ git commit -a # commit to the new branch
$ git branch <new_branch_name> # create the new branch
$ git reset --hard HEAD^ # rewind master
$ git checkout <new_branch_name> # switch to the new branch