2

I have a folder containing both a React app and node.js app. I'm trying to push them to GitHub, but I'm getting errors (some folders don't push and have arrows on them preventing me from opening). Any advice on how to push them both in the same git repo?

File structure as follows:

| Server.js

| routes (for express)

| node modules

| client

├── src

├── public

├── node modules

  • Hey please share the screenshot of your errors and exactly what steps on git did you try to perform. – Lakshya Thakur Feb 13 '21 at 13:56
  • 1
    It's possible that the `client` folder contains `.git` folder, therefore git is considering it as a sub-module. If this is the case, you just need to remove the `.git` folder inside `client`. https://git-scm.com/book/en/v2/Git-Tools-Submodules – Firmino Changani Feb 13 '21 at 17:36

1 Answers1

0

This just happened to me. What happened was the client folder became a git submodule because it contains .git folder (just like Firmino said in the comment)

However, for me deleting .git folder inside the client folder doesn't resolve the issue (as submodule is messy). Referring to How do I remove a submodule?, these are the steps that I did:

  1. Delete .git folder in the client folder
  2. Manually copy the client folder to somewhere else
  3. Delete the client folder: git rm -rf client
  4. Commit & push (with the client folder removed)
  5. Manually paste the client folder back to where it was (inside the git repo)
  6. Commit & push (with the client folder added)
Fransiska
  • 429
  • 5
  • 8