How to commit my current changes to a different branch in git

Posted by Auron on Stack Overflow See other posts from Stack Overflow or by Auron
Published on 2010-05-31T15:26:26Z Indexed on 2010/05/31 15:33 UTC
Read the original article Hit count: 246

Filed under:
|
|

Sometimes it happens that I make some changes in my working directory and I realize that these changes should be committed in a branch different to the current one. This usually happens when I want to try out new things or do some testing and I forget to create a new branch beforehand, but I don't want to commit dirty code to the master branch.

So, how can I make that uncommitted changes (or changes stored in the index) be committed to a different branch than the current one?

© Stack Overflow or respective owner

Related posts about git

Related posts about branch