Search code examples
gitmerngithub-for-windows

Github repository folder saved as shortcut problem


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

Solution

  • 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