I want to remove some files/ folder from git history according to git documentation, but it fails due to unstaged changes
. It is not clear to me what unstaged changes there could be as i did git add --all
, commit & push before. note that the to-be-deleted folder somefolder/
does not exist in HEAD anymore. It was moved on earlier commits, but it's old versions need to be purged from the repo.
~$ git add --all
~$ git commit -m "trying to fix 'Cannot rewrite branches: You have unstaged changes'"
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
~$ git push
Everything up-to-date
~$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
~$ git filter-branch --force --index-filter "git rm --cached --ignore-unmatch somefolder/" --prune-empty --tag-name-filter cat -- --all
Cannot rewrite branches: You have unstaged changes.
~$
how do i fix this so i can run the last command successfully?