Git忽略public / index.html [英] Git ignore public/index.html
问题描述
感谢您提前阅读我的问题.Git始终忽略public / index.html文件。
我通过create-react-app创建了一个项目,它可以成功运行。
但是当我将它推送到Github时,public / index.html丢失了。
git check-ignore -v - public / index。 html
这会告诉你是否有 gitignore / exclude / core.excludesfile
带有忽略规则的文件。
通常,IDE可以在全局gitignore中添加自己的忽略规则文件。
Thanks for reading my question in advance.The Git always ignores the public/index.html file.
I created a project by create-react-app and it works successfully.
But when I push it to Github, the public/index.html was lost.
Take this project for example.
the .gitignore is:
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
I tried to new another index.html and commit/push it again.But it shows nothing to commit. How can I fix this problem? The terminal looks like this:
The command to use whan a file is not added/committed is:
git check-ignore -v -- public/index.html
That will tell you if there is any gitignore/exclude/core.excludesfile
file with an ignore rule.
Typically, an IDE can add its own ignore rules in a global gitignore file.
这篇关于Git忽略public / index.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!