У меня была такая же проблема (components/dashboard/js-dev/training/index.js
не отслеживался по какой-то причине), поэтому я сделал следующее:
$ git check-ignore -v components/dashboard/js-dev/training/index.js
$ (gave me nothing)
$ git check-ignore -v components/dashboard/js-dev/training/
$ /Users/User/.config/git/ignore:23: components/dashboard/js-dev/training/
В любом случае, я обнаружил, что это довольно странно, так что потом явзглянул на этот файл, /Users/User/.config/git/ignore
, и вот как он выглядел:
(this is line 1)
# Automatically created by GitHub for Mac
# To make edits, delete these initial comments, or else your changes may be lost!
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
И получается, что строка 23 на самом деле та, что между .com.apple.timemachine.donotpresent
и # Directories potentially created on remote AFP share
, вдругими словами, это была абсолютно пустая строка!
Я попытался удалить все лишние переводы строк, чтобы мой файл выглядел так:
# Automatically created by GitHub for Mac
# To make edits, delete these initial comments, or else your changes may be lost!
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
Я запускаю git status
, и я замечаю, что этосейчас набирает components/dashboard/js-dev/training/
.Я запускаю git add components/dashboard/js-dev/training/
, и все снова работает нормально.
Надеюсь, это кому-нибудь поможет - эта проблема застряла на слишком долгое время.