我正在尝试在我的git存储库中重写我的历史记录,因为我需要删除包含受限信息的文件.
这是发生的事情:
$ git filter-branch --index-filter 'git rm --cached --ignore-unmatch FILE' master
Cannot rewrite branch(es) with a dirty working directory.
Run Code Online (Sandbox Code Playgroud)
所以我认为"这很奇怪,我很确定我没有未提交的更改",我运行:
$ git status -u
# On branch master
nothing to commit (use -u to show untracked files)
Run Code Online (Sandbox Code Playgroud)
这里发生了什么?有没有人知道会发生什么?此存储库中有子模块.
我有18个子模块(所有Vim插件),这是他们的状态.认为这可能是有用的信息.
$ for i in $(ls); do cd $i; git status -u; cd ..; done;
# Not currently on any branch.
nothing to commit (working directory clean)
# Not currently on any branch.
nothing to commit (working directory clean)
# …
Run Code Online (Sandbox Code Playgroud)