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: wp-content/plugins/bznrd-inventory/ReduxFramework/extensions/location/location/field_location.php
modified: wp-content/plugins/bznrd-inventory/js/admin.js
Asked
Active
Viewed 1,687 times
-3
-
an alternative would be to stash your changes first, then switch to another branch, then continue what you need to do on that other branch. if you want to go back to your changes you can pop it back – Kevin Aug 06 '19 at 07:57
-
Sometimes you can switch branches anyway, even though you have uncommitted changes. Sometimes you can't. See https://stackoverflow.com/q/22082307/1256452 – torek Aug 06 '19 at 16:59
1 Answers
3
2 options:
git stash
to apply your changes to a stash, which you can later restore with git stash apply
, or
git checkout -b wip-branch && git add . && git commit -m "wip" && git checkout <current_branch>

Ohgodwhy
- 49,779
- 11
- 80
- 110
-
You can also use `git stash pop` after `git stash` to apply the changes and delete the stash from the stash stack – Estève Aug 06 '19 at 08:13