0

I have ruby console application which is using grit gem to manipulate git repositories on MacOS.

When call that application from git folder I want to edit, and edit some files, that files will appear in modified as well as in added files in git status. And when want to commit and push those files I get this error:

git '--git-dir=/Users/user/some_dir/.git' '--work-tree=/Users/user/some_dir' add '--' 'edited_file.yaml' 2>&1:fatal: pathspec 'edited_file.yaml' did not match any files

Is there some known reason why this is happening, and also what would be the best way to avoid this?

I'm able to edit the code of this ruby console application, so looking for suggestions how to handle cases like this from application if they can't be handled on git level.

amilanov
  • 1
  • 1
  • What is the exact command you are running to produce that error? It looks like you are trying to commit changes to a file that is not yet tracked. – chepner Apr 27 '15 at 14:03
  • I get this error on git add. All files are there, but I will get error only when start this console application from same folder I try to edit using this application. E.g I call this application from folder /Users/user/some_folder which is git repository in fact, and through application I made changes to /Users/user/some_folder/edited_file.yaml and it will fail when I try git add edited_file.yaml through application. – amilanov Apr 27 '15 at 14:42

0 Answers0