.gitignore not ignoring web.config

半城伤御伤魂 提交于 2019-12-18 10:42:39

问题


For my remote repository, I'm trying to ignore the web.config file of my Umbraco website. The .gitignore is in the root of my website, and the file to ignore, web.config is also in the root of my website.

so I added this line to my .gitignore file:

web.config

But everytime I push changes to my remote repository, the web.config file is also pushed to the remote repository.

What am I doing wrong?


回答1:


git will not ignore a file that was already tracked before a rule was added to this file to ignore it. In such a case the file must be un-tracked with git rm --cached <filename>.

So if you are trying to ignore this file newly, run this: git rm --cached web.config.



来源:https://stackoverflow.com/questions/22038600/gitignore-not-ignoring-web-config

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