0

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:

enter image description here

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:

enter image description here

Additionally, within windows, my file explorer looks like this:

enter image description here

Further thoughts?

Mark
  • 1,812
  • 3
  • 29
  • 51

2 Answers2

2

/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.

Jake Haller-Roby
  • 6,335
  • 1
  • 18
  • 31
  • thanks for the info, but is failing. Added additional info to my original question. – Mark Jan 26 '18 at 22:11
0

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?

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • I did a `rm -rf .git` and that removed the hidden git folder and therefore should have removed the history as well. Is that not correct? Actually, I did that, did a `git init` and also reset the upstream repo within Azure. – Mark Jan 26 '18 at 22:59
  • @Mark That works, too, if you want to start over from scratch – Code-Apprentice Jan 26 '18 at 23:13