Search code examples
gitcreate-react-app

Cannot git add my project created with create-react-app


I created a a folder called Tiendas_Unison_WEB in which i have my application, here i have 2 subfolders: client and server.

enter image description here

In my server folder i have an app created with express and node, this is fine, no problem with that. In my client folder i have a react app created wit "npx create-react-app" and i'm having issues with this one. What I did was "git init" on my parent folder "Tiendas_Unison_WEB", but when doing "git add ." I get the following warning: enter image description here

I've searched for answers and solutions but I haven't been able to find them. I dont know if I should have my client folder and my server folder in different repositories, maybe that's the problem. Any hint that might help me would be appreciated


Solution

  • Warning message tells, that client folder itself is already git repository. Open the folder, and check for hidden .git file; I guess it will be there. So if you'd like to keep client folder as git repository - then add it as git submodule to your main repository (for that you need to know its remote address, e.g. url of the git server); or if you do not want it, simply remove .git file from the client folder.