Github repository folder saved as shortcut problem
Asked Answered
E

1

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
Erysipelas answered 13/8, 2021 at 6:15 Comment(4)
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.)Hertford
@Hertford It is not a submodule, but a gitlink. I believe we already had this conversation ;) (#59634036)Exfoliation
@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.)Hertford
@Hertford 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 (github.com/git/git/commit/…), before talking about submodule and "supermodule" (github.com/git/git/commit/…)Exfoliation
E
3

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
Exfoliation answered 13/8, 2021 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.