Git react folder in Gitlab

Issue

I’m going to make a git to my project include spring and react, as shown below:

the content in my project folder

after I create a local repo and just push this into gitlab as it told me: btw before I git push I have to write "git pull –rebase origin main", otherwise I can’t push my repo to gitlab. But I think that is maybe not the reason.
the process I have made to push the local repo to gitlab

And afterwards it has problem with the react folder in gitlab, and there is no problem with the spring folder, as shown below: I can’t open the react folder in gitlab.

how it looks like in the gitlab

So my question was: why only the react folder has this problem but spring not? and how can I fix it? When I open the react folder by vs code, the version control tool also doesn’t work when I made some changes.

Very thankful for answering!

Solution

why only the react folder has this problem but spring not?

Because delivery-react is probably a nested Git repository (meaning there is a delivery-react/.git), unless you have a .gitmodules file in your main repository.

If you want to add delivery-react as a regular folder:

git rm --cached delivery-react  # no trailing /
git commit -m "Remove nested folder"
git add delivery-react
git commit -m "Add deliver-react"
git push

Answered By – VonC

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published