"Cannot rewrite branch(es) with a dirty working directory".
I am new to Git - I tried googling for an answer to no avail.
What does this error mean? What should/can I do?
A dirty working directory means you have uncommitted changes to your branch. You can either commit them or stash them. To stash just use:
git stash And use this to bring your changes back
git stash apply filter-branch. So try running these two commands anyway - unless anyone knows of a less hacky way to force index refresh. (More discussion of this on this question .)git update-index -q --ignore-submodules --refresh should update the index!git stash pop to apply the last stashed changes and remove them from the stash list. apply will apply the changes but a git stash list still shows the stashed changes.
git filter-branch --subdirectory-filter somedir -- --allI end up with my whole repo processed but if I dogit filter-branch --tree-filterrm somefile` -- --all` it quits after processing the first branch with the error mentioned above. Why doesfilter-branchsave the state of--subdirectory-filterbut stop if--tree-filterchanges the directory?