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.

Original source

Related problems