Prevent a deleted file from being tracked in Git
Often it may happen that you need to delete a file such that it should no longer be tracked by GIT. If you simply delete the file from the file system, git detects that a file has been deleted but it does not get deleted from the commit itself sincs its an unstaged change. To delete a file from your filesystem as well inform git of this deletion in this commit, you can run But what if you only want to delete the file from the commit but retain it in your local directory. You can run Using this, git will be informed that the file no longer needs to be tracked hereafter unless added explicitly. Anyone who now pulls from this branch will have their local file deleted since git will no longer stores information about this file from this commit onwards.git rm filename
git rm --cached filename