问题
So I am trying to push my initial commit using the create-react-app
from a local git build. My .gitignore
looks like such:
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
And my directory looks like this:
Left the directory structure the same by default, so why is it uploaded node_modules
as well?
UPDATED INFO:
So revised that in my git ignore, but it seemed to have still pushed the `node_modules'. My git root is theapp > build / node_modules / public / etc... if that helps.
I went ahead and allowed it, but at the end of my push with git push azure master
, I got this now:
Additionally, within windows, my file explorer looks like this:
Further thoughts?
回答1:
/node_modules
is looking at the root of your computer.
What you want is node_modules/
. Which looks for that directory relative to your current position.
回答2:
After you fix your .gitignore
file, the directory still remains in the history. To permanently remove node_modules
from the history, see How to remove/delete a large file from commit history in Git repository?
来源:https://stackoverflow.com/questions/48468847/create-react-app-git-pushing-node-modules