If I run git status:
# On branch new-media
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .gitignore
# modified: app/views/layouts/application.html.erb
Then I checkout the master: with git checkout master
M .gitignore
M app/views/layouts/application.html.erb
Switched to branch 'master'
Previously, git stopped me from checkout other branches, prompting me to either stash or commit the changes I've made on the current one. Now, it no longer does so.
Git switches branches with a dirty working directory just fine if the changed files are the same on both branches. If not, it will stop you. You can override this behavior with the -m flag.
See
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With