How do I remove a deleted but committed file from git?
I a have a file that has been moved from its folder, git sees this file as removed, so you run:
git add -u
This adds the deleted file to your ‘Changes to be committed’, I’ve tried to use:
git rm git clean -f and -n
Has anyone come across a similar issue? Here what the
git status states:
git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) deleted: path/file.txt
I’m running Windows 8 with git bash.
2 Solutions collect form web for “How do I remove a deleted but committed file from git?”
to commit changes, do
I believe you are trying to remove a file from the entire git history.
To do so, following the answer on the following page will help:
Remove sensitive files and their commits from Git history