create-react-app 忽略 github 中的 .gitignore

creact-react-app ignores .gitignore in github

我是 React 的新手 我正在使用命令行 util create-react-app https://github.com/facebook/create-react-app 创建一个新的样板文件。当我创建一个新的存储库、提交并推送锅炉应用程序时,我看不到我的 src 文件夹。发生这种情况有原因吗?

.gitignore

# 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*

你 运行 git add . 是否在包含你的 .git 目录的同一目录中,即项目的根目录,提前 运行ning git commit?这实际上是将文件添加到您的提交中的内容

这条线帮我做了

 git add --force react-app/ignore/