1

I am trying to push a MERN stack repository on my GitHub but the client folder is saved as a shortcut, I have tried deleting the git folder inside the client but still it won't work enter image description here

What I have tried at gitbash

> git init
> git status
> git add .
> git status
> git commit -m "John ..."
> git remote add origin linktogithubrepo.git
> git push -u origin main
torek
  • 448,244
  • 59
  • 642
  • 775
  • That's not a *shortcut*, that's a *submodule*. The gitlink that VonC describes is how Git stores submodules—or rather, it's a big chunk of how, but without the `.gitmodules` file, there's a piece missing. I like to call these "half-assed submodules". (You can use them on purpose for special cases, but usually they're just mistakes.) – torek Aug 13 '21 at 17:40
  • @torek It is *not* a submodule, but a gitlink. I believe we already had this conversation ;) (https://stackoverflow.com/questions/59633536/git-submodules-without-gitmodules-file#comment105444518_59634716) – VonC Aug 13 '21 at 18:50
  • @VonC: that's why I call them half-assed submodules. :-) (Note that the displayed icon is the same for a "fully-assed" submodule gitlink, and one of these, so I'll agree that "gitlink" is a better term. It somehow feels even worse in terms of "degree of jargon" than submodule, though.) – torek Aug 13 '21 at 21:06
  • @torek The icon is the same, but a gitmodules adds, near that icon, the SHA1. A gitlink alone references a "subproject", as Linus called those originally, when gitlink was fleshed out (https://github.com/git/git/commit/0ebde32c87da2efac5985a808e6bd4130831b7a8), before talking about submodule and "supermodule" (https://github.com/git/git/commit/f0807e62b42df51a079c730dcf4868de9ad44ea5) – VonC Aug 13 '21 at 21:34

1 Answers1

2

Deleting the .git folder is not enough.

You need also to delete the gitlink (a special entry in your index) representing the root folder of that nested repository:

git rm --cached client # no trailing /
git add .
git commit -m "Import client content"
git push
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250