我想根据git 文档从 git 历史记录中删除一些文件/文件夹,但由于unstaged changes. 我不清楚可能会有哪些未分阶段的更改,就像我 git add --all之前所做的那样,提交并推送。somefolder/请注意, HEAD 中不再存在要删除的文件夹。它已在早期提交中移动,但旧版本需要从存储库中清除。
~$ 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 …Run Code Online (Sandbox Code Playgroud) git ×1