How do I push a node project to GitHub that contains a create-react-app in a subfolder?

Viewed 3013

I'm currently working on my first MERN app. I have some issues regarding pushing my app to GitHub. My app file structure is as follows:

├───myApp
│   ├───server.js
│   ├───connection.js
│   ├───controls
│   ├───models
│   ├───client  <-- create-react-app folder

I know that using create-react-app will run git init as well. So, if I try to get my full app on GitHub I will get a git repo inside a git repo:

enter image description here

Is there a way to remove git from the create-react-app and push my whole app to one repo?

Thanks

2 Answers

Fixed the issue by deleting the .git folder inside the client

On github, you will be able to deploy only the react app. Not your backend. The easiest way is to deploy to a gh-branch branch the dist folder created by create-react-app when you run the build command.

Related