I just want to simply git add my React project to my class Gitlab, but I get a warning:
saying:
warning: adding embedded git repository: frontend-Projekt
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> frontend-Projekt
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached frontend-Projekt
hint:
hint: See "git help submodule" for more information.
I don't understand what I did wrong. Can someone help me? Or maybe tell me how to restart git bash so it would work normally again, because I tried reinstalling it and the warning still occurs.
You were already in a Git repo when you ran npx create-react-app …. This creates a new React app in a new Git repo.
Now you have a Git repo in a Git repo — not what you want.
git reset the .git folder in the React app’s folder to undo the git add..git folder from the React app folder.Also see Why is a .git folder automatically being created when creating a react app?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With