Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.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
GitHub未忽略。gitignore目录_Github_Github Actions_Github Cli - Fatal编程技术网

GitHub未忽略。gitignore目录

GitHub未忽略。gitignore目录,github,github-actions,github-cli,Github,Github Actions,Github Cli,我有一个Laravel项目,当推送到GitHub时,我的带有.gitignore的目录仍然被推送到GitHub,当我这样做时: git add . git commit -m "Sample commit." git remote add origin git@github.com:My.git git push origin master storage/framework/中的所有缓存和会话数据都被推送到GitHub,即使storage/framework/具有.git

我有一个Laravel项目,当推送到GitHub时,我的带有.gitignore的目录仍然被推送到GitHub,当我这样做时:

git add .
git commit -m "Sample commit."
git remote add origin git@github.com:My.git
git push origin master
storage/framework/中的所有缓存和会话数据都被推送到GitHub,即使storage/framework/具有.gitignore。带有.gitignore的所有其他目录也被推送到GitHub

我做错了什么?

包含要忽略的故意未跟踪文件的列表


您可以检查.gitignore中给出的模式是否与您不想提交的文件/目录匹配。

检查是否#1。gitignore文件位于存储库的根文件夹中(不是必需的,但建议使用)#2。gitignore模式/路径是相对于gitignore文件位置3正确指定的。gitignore文件中的模式是正确的。为了更清楚,您可以在代码中添加文件夹结构和.gitignore文件。谢谢。我需要添加存储/framework/sessions/.gitignore和*!。gitignore