Git Remove File From Repo That Has Been Added To

[Solved] Git Remove File From Repo That Has Been Added To | Shell - Code Explorer | yomemimo.com
Question : git remove file from repo that has been added to gitignore

Answered by : envious-elk-ymmykgfj0mpx

Commit any files that you need to change/delete to the repo. Then:
git rm -r --cached . # this will clean all files from cache. To clean a single file, exchange '.' with filename
git add . # add all of the now uncached files that are not gitignored to the staging area
git commit -m "fix .gitignore" # commit the changes

Source : http://www.codeblocq.com/2016/01/Untrack-files-already-added-to-git-repository-based-on-gitignore/ | Last Update : Thu, 01 Oct 20

Question : remove gitignore files

Answered by : hurt-hummingbird-z8ayer93g4uh

git ls-files --ignored --exclude-standard -z | xargs -0 git rm --cached
git commit -am "Remove ignored files"
// answer from: thSoft

Source : https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore | Last Update : Fri, 03 Jul 20

Answers related to git remove file from repo that has been added to gitignore

Code Explorer Popular Question For Shell