Applying .gitignore to committed files
git
Solution
- Edit `.gitignore` to match the file you want to ignore
- `git rm --cached /path/to/file`
See also:
- How do I git rm a file without deleting it from disk?
- Remove a file from a Git repository without deleting it from the local filesystem
- Ignoring a directory from a Git repo after it's been added
Problem
I have committed loads of files that I now want to ignore. How can I tell git to now ignore these files from future commits? EDIT: I do want to remove them from the repository too. They are files created after ever build or for user-specific tooling support.
Related problems
- Recursive git update-index --assume-unchanged
- Remove a file from a Git repository without deleting it from the local filesystem
- How do I git rm a file without deleting it from disk?
- Ignore files that have already been committed to a Git repository
- How to revert a "git rm -r ."?
- Ignoring a directory from a Git repo after it's been added
- Applying hgignore file to already committed file Mercurial repo