[git push issue] Anyone can help me resolve this issue?

Hey guys, I’m building a MERN stack web application. And below is my base setup for the frontend(client) and backend(server). When I tried to push all the folders(client and server) I got such yellow warning/ hint messages which I don’t understand at all.
But I pushed anyway.
**

BUT THE REAL PROBLEM IS,
I can’t access to the client folder on my github repository

**
So here are my questions

  1. What’s the problem???
  2. Why such an issue happen?
  3. What to do to resolve this problem? (how to make it accessible to both folders on GitHub repository)


Hi @ryan.developer99, I think the hint section is pretty self explanatory:

you have a .git history folder nested inside another .git history folder. And that’s a big no-no.

Let me guess you wanted to track both client and server in the same repo, but I assume you added a new git history in the client by default.

I guess the client git was unintentional, but remember that many bootstrapping tool add git history by default, for example create-react-app.

So you now have a structure like this:

.git
server/
client/
  .git

What you can do, is remove the .git folder from the client folder, then your “outer” git should pick it up and fix it.

Another possible solution is to keep the two project separated, so you’ll have two Github repos: one for the client and one for the server.

Both are valid options. :slight_smile:

1 Like

Remove the .git folder & .gitignore in the client folder, it comes initialized on default with React. Then repeat the process. Happy coding!

1 Like

Ah ha~~~!!! Now I clearly understand the reasons why I got that error!!! Thank you so much for your detailed explanation of the solution!!

Thank you so much for the solution !! :slight_smile: Happy Coding~~!!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.