I’m currently working on multiple changes/bugs and I would like to be able to work on these individually using individual local branches. But when I am in the middle of working on something on for example branch_a and then I need to start work on a new hot project, and I create a branch_b, I still have the changes that I made from branch_a.
Here is the workflow:
- Created and checked-out local
branch_afromdevbranch - Made local changes to
branch_a(but no staging viagit addor commits locally) - Needed to start on a new hot bug so switched to
devbranch, and created and checked-outbranch_b - Perform a
git statusand I see the changes I made onbranch_a
How do I create a new branch that doesn’t have the changes I made on branch_a?
Also, when I checkout another branch I get
$ git checkout branch_b
M app/controllers/stuff.rb
M app/views/stuff/index.html.erb
Switched to branch 'branch_b'
What does the M represent?
Thanks
The M means modified. First you have to commit your changes to your current branch or stash them.
When you want to stash them:
When you choose to commit your changes: