Home > Enterprise >  (Github Desktop Win64) 'Invalid Path' error when trying to commit changes to new repositor
(Github Desktop Win64) 'Invalid Path' error when trying to commit changes to new repositor

Time:11-06

I have been developing an ASP.NET Core application, and I am trying to push it to GitHub. In GitHub Desktop, when I try to commit the changes (initial commit), I keep getting the following warnings and error:

warning: LF will be replaced by CRLF in .gitattributes.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/presentation/abcl.WebApi/appsettings.Development.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/presentation/abcl.WebApi/bin/Debug/net5.0/appsettings.Development.json.
The file will have its original line endings in your working directory
error: invalid path 'src/presentation/frontend/'
error: src/presentation/spa/: cannot add to the index - missing --add option?
fatal: Unable to process path src/presentation/spa/

The project root is C:\abcl, and the full path to the folder giving the error is C:\abcl\src\presentation\spa

I have tried changing the 'spa' folder to a variety of different names, but it doesn't seem to make any difference. I don't see any illegal characters in this path or understand how it could be invalid. I have tried migrating to the project root and running git config core.protectNTFS false in a CLI, but no dice.

I am pretty new to GitHub, so not quite sure what to do.

EDIT Using the CLI, I was able to get other files to commit, but for some reason it doesn't like this abcl/presentation/spa directory. On github, it appears as a folder with an arrow (is this a symlink?) and I can't access the contents of it.

enter image description here

CodePudding user response:

On github, it appears as a folder with an arrow (is this a symlink?)

It is a gitlink, a representation of the root tree of a nested Git repository.

Check if there is a spa\.git subfolder, and remove it (assuming you are not interested in the history of said subfolder).
Then:

git rm src/presentation/spa # no trailing /
git add src/presentation/spa
git commit -m "Add src/presentation/spa"
git push
  • Related