git status显示了一个我已经在.gitignore文件中明确列出的文件 [英] git status shows a file that I have listed explicitly in my .gitignore file

查看:105
本文介绍了git status显示了一个我已经在.gitignore文件中明确列出的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的.gitignore文件中有以下行:

  var / www / docs / .backroom / billing_info / inv .pl 

但是当我输入'git status'时,我被告知以下内容:

 #modified:var / www / docs / .backroom / billing_info / inv.pl 

我不明白,当我希望git忽略它时,如何将明确列为忽略模式的文件列为已修改。



没有以!开头的行!在我的.gitignore文件中



以下是我的整个.gitignore文件以供参考: http://pastebin.com/Jw445Qd7

解决方案

只有当 inv.pl 已被追踪(请参阅 gitignore 手册页)。



尝试( git rm )a:

  git rm --cached var / www / docs / .backroom / billing_info / inv.pl 

如果文件已经提交,请参阅此所以答案< a>。


I have the following line in my .gitignore file:

var/www/docs/.backroom/billing_info/inv.pl

but when I type 'git status' I am told the following:

#   modified:   var/www/docs/.backroom/billing_info/inv.pl

I dont understand how a file which is explicitly listed as an ignore pattern could be listed as modified when I want git to ignore it.

There are no lines starting with a ! in my .gitignore file

Here is my entire .gitignore file for reference: http://pastebin.com/Jw445Qd7

解决方案

That should only happen if inv.pl is already tracked (see gitignore man page).

Try (with git rm) a:

git rm --cached var/www/docs/.backroom/billing_info/inv.pl

If the file is already committed, see this SO answer.

这篇关于git status显示了一个我已经在.gitignore文件中明确列出的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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