0

I've been using Git Flow to help manage branch and workflow. I love how it works, although have a general question when working with multi feature branches.

For an example I would start a feature branch, make some adjustments. If I then create another feature branch, the new changes are also included in this feature branch. If I want to complete one feature branch and finish it, it won't let me unless I commit all untagged files.

Is there a better way to handle this work flow? So that I can have multi feature branches, and finish off a branch, and checkout/commit only the changes I want?

The idea is to be able to work on different issues and push code from that fix, still having different feature branches with uncommitted updates.

Thanks!

4

1 回答 1

1

如果您有两个功能分支 A 和 B,并且您在功能分支 A 上工作,请不要提交并切换到 B,未提交的更改将跟随您到 B 分支。这就是 git 的工作方式。您可以提交更改或存储更改。

根据您的要求,您似乎正在寻找 git stash。

有关 git stash 的更多信息,请参阅文档: http ://www.kernel.org/pub/software/scm/git/docs/git-stash.html

于 2012-10-15T18:09:05.080 回答