5

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
  • 2
    Why not just deleting client/.git? Commented Jun 23, 2019 at 15:11
  • 1
    I'm pretty sure you can just delete the git folder in your create-react-app then you can add it to your main repository. It is a hidden folder so you will have to show hidden files. Commented Jun 23, 2019 at 15:14

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.

2 Comments

Thanks for your answer. But, I do not want to deploy my app yet. It's just for keeping track of my versions.
You can do en -Rf of the .git folder inside your client folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.