.gitignore不会忽略web.config [英] .gitignore not ignoring web.config

查看:509
本文介绍了.gitignore不会忽略web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的远程存储库,我试图忽略我的Umbraco网站的web.config文件。
.gitignore位于我的网站的根目录下,并且忽略该文件,web.config也位于我的网站的根目录中。

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.

web.config

但是每当我将更改推送到远程存储库时,web.config文件也会被推送到远程存储库。

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

我在做什么错了?

推荐答案

git不会忽略已添加规则之前已被追踪的文件这个文件忽略它。在这种情况下,文件必须使用 git rm --cached< filename> 来取消。

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>.

因此,如果您试图忽略此文件,请运行以下命令: git rm --cached web.config

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

这篇关于.gitignore不会忽略web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆