The problem is that .gitignore
ignores just files that weren’t tracked before (by git add
). Run git reset name_of_file
to unstage the file and keep it. In case you want to also remove the given file from the repository (after pushing), use git rm --cached name_of_file
.
More Related Contents:
- What are the differences between .gitignore and .gitkeep?
- .gitignore is ignored by Git
- ignoring any ‘bin’ directory on a git project
- Gitignore not working
- How do I ignore files in a directory in Git?
- How to create a .gitignore file
- Should I check in folder “node_modules” to Git when creating a Node.js app on Heroku?
- How do I add files without dots in them (all extension-less files) to the gitignore file?
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- How do I make Git forget about a file that was tracked, but is now in .gitignore?
- When would you use .git/info/exclude instead of .gitignore to exclude files?
- How do .gitignore exclusion rules actually work?
- What is .gitignore?
- How to exclude file only from root folder in Git
- Using .gitignore to ignore everything but specific directories
- gitignore all files of extension in directory
- Apply .gitignore on an existing repository already tracking large number of files
- What’s the difference between Git ignoring directory and directory/*?
- Why doesn’t Git ignore my specified file?
- git still shows files as modified after adding to .gitignore
- gitignore does not ignore folder
- Git: How to remove file from index without deleting files from any repository
- Git: Ignoring Version-Controlled Files
- Git – Creating a .gitignore file
- Remove directory from remote repository after adding them to .gitignore
- Why is git is ignoring files that aren’t in the .gitignore file?
- Definitive retroactive .gitignore (how to make Git completely/retroactively *forget* about a file now in .gitignore)
- How to .gitignore all files/folder in a folder, but not the folder itself? [duplicate]
- Unignore subdirectories of ignored directories in Git
- Ignoring a directory from a Git repo after it’s been added