Git: rm –cached – fatal: pathspec ‘filename’ did not match any files

Автор: | 04/02/2016

git-logoЕсть добавленные файлы:

# git status
...
#
#	new file:   .gitignore
#	new file:   name_devops.json
#	new file:   clients/client/client.json
...
#	new file:   clients/run.sh
#	new file:   internal/internal.json
#
...

При выполнении git rm – возникает ошибка:

# git rm -r --cached *
fatal: pathspec 'token_keys.txt' did not match any files

Добавляем опцию --ignore-unmatch:

–ignore-unmatch
Exit with a zero status even if no files matched.

Запускаем еще раз:

# git rm -r --cached * --ignore-unmatch
rm 'name_devops.json'
rm 'clients/client/client.json'
...
rm 'clients/run.sh'
rm 'internal/internal.json'

Готово.