Even if you haven’t tracked the files so far, Git seems to be able to “know” about them even after you add them to .gitignore
.
WARNING: First commit or stash your current changes, or you will lose them.
Then run the following commands from the top folder of your Git repository:
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
Related Contents:
- Make .gitignore ignore everything except a few files
- How do I configure git to ignore some files locally?
- How to create a .gitignore file
- .gitignore exclude folder but include specific subfolder
- .gitignore for Visual Studio Projects and Solutions
- How to .gitignore all files/folder in a folder, but not the folder itself? [duplicate]
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- git add only modified changes and ignore untracked files
- .gitignore all the .DS_Store files in every folder and subfolder
- Remove directory from remote repository after adding them to .gitignore
- Gitignore not working
- What to gitignore from the .idea folder?
- Should you commit .gitignore into the Git repos?
- Apply .gitignore on an existing repository already tracking large number of files
- Remove file from the repository but keep it locally
- .gitignore after commit [duplicate]
- What is .gitignore?
- gitignore does not ignore folder
- When would you use .git/info/exclude instead of .gitignore to exclude files?
- gitignore binary files that have no extension
- Using git, how do I ignore a file in one branch but have it committed in another branch?
- .gitignore not ignoring .idea path
- Keep ignored files out of git status
- How to git ignore ipython notebook checkpoints anywhere in repository
- Can I make a user-specific gitignore file?
- Should bower_components be gitignored?
- When to use leading slash in gitignore
- .gitignore exclude specific file
- Unignore subdirectories of ignored directories in Git
- Force git to update .gitignore
- What’s the difference between Git ignoring directory and directory/*?
- Whitelisting and subdirectories in Git
- Correctly ignore all files recursively under a specific folder except for a specific file type
- Add newly created specific folder to .gitignore in Git
- what should be in .gitignore file for a netbeans java project?
- Commit empty folder structure (with git) [duplicate]
- How do I ignore all files in a folder with a Git repository in Sourcetree?
- git doesn’t ignore 2 specifically named files
- git: have different .gitignore file for each remote
- Best Practice for Adding .gitignore to Repo
- How to I add something to the .gitignore so that the match is not recursive?
- How to manage configuration files when collaborating?
- gitignore does not ignore .idea directory
- Yarn v2 gitignore
- git add adding ignored files
- .gitignore: How do I ignore nested directories?
- How to ignore the same name directory __pycache__ in a project?
- How do I ignore file extensions in git regardless of case?
- .gitignore whitelist on directory and its contents
- .gitignore: Ignore one specific directory and that one only [duplicate]