I'm trying to make a shell.sh that when run with bash will basically just run command: git ls-files -o -i --exclude-standard
which works perfectly when run from base repo directory, but when i change current directory to *repo/folder and run it from there, there is no output.
so: \
*repo/git ls-files -o -i --exclude-standard -- good \
*repo/folder/git ls-files -o -i --exclude-standard -- no bueno
does anyone know why it does this and how to remediate? Thanks
Running
git ls-filesis a little like runningls -R-- it only considers files in the current directory or below. It's producing no output because (presumably) the only files matching your criteria existing only at the top level of the repository.It sounds like you always want to run
git ls-filesfrom the top directory, regardless of your current location. You can do that like this: