Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Git中从钉扎区域隐藏文件_Git_Gitignore - Fatal编程技术网

在Git中从钉扎区域隐藏文件

在Git中从钉扎区域隐藏文件,git,gitignore,Git,Gitignore,我无法通过git status命令隐藏特殊文件 例如,我不想在我的项目中包含phpstorm.php,我将它添加到gitignore中 但当我使用git status命令时,会显示如下消息: 未跟踪的文件: (使用“git add…”包含在将提交的内容中) phpstorm.php 实际上,我想要phpstorm.php,但要隐藏git状态 感谢在.gitignore文件中添加/phpstorm.php或phpstorm.php /phpstorm.php将同一文件夹的phpstorm.php文

我无法通过git status命令隐藏特殊文件

例如,我不想在我的项目中包含phpstorm.php,我将它添加到gitignore中

但当我使用git status命令时,会显示如下消息:

未跟踪的文件: (使用“git add…”包含在将提交的内容中) phpstorm.php

实际上,我想要phpstorm.php,但要隐藏git状态


感谢在
.gitignore
文件中添加
/phpstorm.php
phpstorm.php

/phpstorm.php
将同一文件夹的
phpstorm.php
文件与
.gitignore
匹配

phpstorm.php
匹配所有文件,例如包括
someFolder/phpstorm.php


有关更多信息,请参阅。

我们可以查看该文件吗?它的名字是
.gitignore
?它是否与
phpstorm.php
处于同一目录级别?较高的?放低一点?@phd很抱歉我的解释不好,当我问“我们能看到文件吗?”时,我只想解开phpstorm.php文件,我的意思是
.gitignore
。你把它命名为
.gitignore
还是
gitignore
?哦,我忘了把它添加到gitignore,谢谢@phd