charles
charles

Reputation: 11752

Git: committing a symlink to a folder

When adding to the index a symlink to a directory, I get the following error message:

fatal: pathspec 'XXX' did not match any files

The file is there, and it is indeed a symlink, even to a directory inside the repository in fact.

Upvotes: 6

Views: 1552

Answers (1)

charles
charles

Reputation: 11752

At least on my machine (Mac OS 10.7), the solution was to have the symlink actually point to some real content. In other words, the way the symlink was setup in the repository was that it was 'broken' (this was intentional: during the build process, that symlink would eventually become active in the final product). So I created a directory where the symlink was expecting it, was able to commit without an error, and then could delete that directory.

Upvotes: 5

Related Questions