Git won't ignore files

孤街醉人 提交于 2019-12-20 04:16:56

问题


I have some log files that I want Git to ignore. They are all in:

/Lead Services/logs/

In the .getignore file, I have tried entering all of these:

/Lead Services/logs
/Lead Services/logs/
/Lead Services/logs/*
/Lead Services/logs/**

I've even tried to enter specific files:

/Lead Services/logs/LeadAcceptance-LocalDev.txt

No matter what I try, these files keep showing up in Team Explorer under "Changes". What am I doing wrong?


回答1:


You can use git rm to exclude file from tracking permanently. In your local repository, do

git rm -r --cached logs/*

then

git add .
git commit -m "Excluded logs from tracking"
git push

From now on, the git won't track the logs folder, any more. Also, you may refer to this question.



来源:https://stackoverflow.com/questions/35070091/git-wont-ignore-files

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