I tried to understand How to undo a commit and commit the changes into the other branch in Git? but I don't think it has to be that hard. (Answer is using branch -f
and stash
and I don't think I need those.)
I was working in my dev branch. Had two different commits in dirty working dir. Commit all changes in two different commits. Last commit is WIP (so dev material). Second to last is done and should be copied to stable
branch.
I imagine something like
$ git copy e87568fa stable
but I'm pretty sure that's not it.
Has cherry picking got something to do with it?
To be sure: I want the commit to stay on dev
. So not mv
it, but cp
it.
I'm still baffled by all these GIT options and commands.