bodger bodger - 3 months ago 12
Git Question

Storing incomplete work with git flow

I'm just getting to the stage where something like git flow is going to come in very handy with my project but I'm a bit unsure as to how to swap between features when the feature I'm currently working on isn't quite done.

So if I have a project and I do

$ git flow feature start feature1


then do some work but not quite get it to the stage where I'm happy to commit it before I need to head off and work on another issue, what should I do with my work before I do

$ git flow feature start feature2


?

Is git stash the correct way to go? It doesn't quite seem to do what I want it to do and looks like it could get quite messy quite quickly. But I definitely don't want to commit my changes and it seems silly to have re-clone the entire repo in another directory so I can work on it separately.

Answer

This is kind of the rationale for git stash!

That said, you could just create a commit, and then do git reset --soft HEAD^ when you come back to it (which deletes the commit, but retains the changes in your working copy).

Comments