.gitignore Doesn't Seem To Work

£可爱£侵袭症+ 提交于 2019-12-29 08:56:08

问题


My .gitignore:

.DS_Store
/.idea
/.idea_modules
/out
/project
/target
/*.iml
*/resolution-cache/*
*/streams/*
*/target/*

But nonetheless, the folders .idea, .idea_modules and target have appeared in a repo and are still there.

Your ideas?


回答1:


Ignoring is only useful for files that are not currently being tracked by the repo. If those directories were added to the repo before being put in .gitignore, they will continue to be tracked.

Use git rm --cached <file> to stop tracking a file.

Of course you should make a commit with the removed files and push to the repo to see the changes in the remote repository



来源:https://stackoverflow.com/questions/20974914/gitignore-doesnt-seem-to-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!