taking files out of git
I am maintaining a project that was done in typescript. All the files - .ts (good!), .js(bad!), .map(bad!) - were put in git. Putting the .js and .map in gitignore only tells me they are being ignored but are still tracked in git (and they are shown when I attempt to make a commit). How do I get the .js and .map either out of git, or some way to have them not tracked by git? Should I delete them from my project - and if so, will the .ts recreate them?
I saw one or two support postings about this, but they were quite old.
请先登录再写评论。
I had to do them previously using git rm at the command line. Adding them to the ignore doesn't actually remove the files.
.gitignoreonly affects unversioned files (they are not suggested for addition, and can only be added using 'force' option -git add -f).If you added your files to Git index before specifying them in
.gitignore, the only way to get them ignored is removing them from Git (git rm --cached your_file, etc)Thanks, Elena. What is the difference between a git rm, followed by a commit, and deleting the files through the ide followed by a commit (since typescript generates the .js and .js.map)?
No difference - once you perform commit, locally deleted files are removed from Git