git rm --cached file
should do what you want.
You can read more details at git help rm
More Related Contents:
- How can I make Git "forget" about a file that was tracked, but is now in .gitignore?
- Remove a file from a Git repository without deleting it from the local filesystem
- Ignore files that have already been committed to a Git repository [duplicate]
- How can I delete a file from a Git repository?
- How do you fix a bad merge, and replay your good commits onto a fixed merge?
- Removing multiple files from a Git repo that have already been deleted from disk
- Git: list only “untracked” files (also, custom commands)
- How to revert a “git rm -r .”?
- Completely remove files from Git repo and remote on GitHub
- How do I make Git forget about a file that was tracked, but is now in .gitignore?
- How do I delete a file from a Git repository?
- Remove a folder from git tracking
- Why are there two ways to unstage a file in Git?
- Git: How to remove file from index without deleting files from any repository
- Removing multiple files from a Git repo that have already been deleted from disk
- Why there are two ways to unstage a file in Git?
- Recover staged but not committed files after ‘git rm -rf’
- When is git rm -f used?
- Handle git branching for test and production
- How to remove a dangling commit from GitHub?
- Import existing source code to GitHub
- What are .git/info/grafts for?
- Is there a way to put multiple projects in a git repository? [closed]
- How to determine if Git handles a file as binary or as text?
- Define git alias with the same name to shadow original command
- Visual Studio 2017 – Git failed with a fatal error
- Does TortoiseGit actually make Git a lot easier to use like TortoiseSVN? [closed]
- Git mergetool generates unwanted .orig files
- git push heroku master says “Everything up-to-date”, but the app is not current
- How can I move all git content one-level up in the folder hierarchy?