1

I have a group of projects that I've been compiling on Github as part of the Frontend Mentor challenges - https://github.com/MikeBish13/frontend-mentor-challenges

These are all stored in the same folder locally on my PC and every time I add a folder, VS Code recognises this and queues that folder up to be committed and then pushed to the Github folder.

I've just created a new React App via create-react-app and have added that to my folder locally on my PC and I now want to add it to the folder on Github, but VS Code is not recognising it as a new folder and won't let me commit, and then push changes.

Does anybody know how I could do this? Are there settings I need to change in the React project?

I've run npm build on my React project, if that makes any difference, but I've not changed or added anything new other than the initial create react app.

It's probably a simple answer but I'm a novice when it comes to React/Github.

UPDATE:

Here is a screenshot of my folder structure

enter image description here

user8006446
  • 247
  • 1
  • 5
  • 11
  • Do you have `.gitignore` file? – Daniel_Knights Sep 25 '20 at 15:59
  • Yes, it looks like this. I've not changed anything yet. # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies /node_modules /.pnp .pnp.js # 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* – user8006446 Sep 25 '20 at 16:03
  • I think your problem is that you are not ignoring the `node_modules` folder inside your React application folder. You should add to the `.gitignore` at your folder root with the following line: `node_modules/`. Check this answer for more information: https://stackoverflow.com/a/47825219/1930817 – guzmonne Sep 25 '20 at 16:06
  • So I added a .gitignore file to the root folder and include node_modules/ but VS Code still isn't recognising the React project – user8006446 Sep 25 '20 at 16:16
  • Hi, try this. In your new React App there should be a .git folder (maybe hidden). Delete it and try. I think VS code recognizes your new React App as a separate GIT repo. – Osusara Kammalawatta Sep 25 '20 at 16:22
  • I can't find a .git folder, only the other .gitignore file from the original create react app – user8006446 Sep 25 '20 at 17:03
  • share your folder structure .. screenshot inside VS code with the folder in question expanded. Might shed some light – Squiggs. Sep 25 '20 at 17:39
  • Folder structure shared above – user8006446 Sep 26 '20 at 08:50

0 Answers0