Не могу добавить.показывает предупреждение: не удалось открыть каталог - PullRequest
0 голосов
/ 27 января 2019

Я новичок в программировании и хочу изучить его, у меня возникла проблема при сохранении изменений с Visual Code на github.Я отредактировал файл в Gemfile, gemfile.lock и route.rb в VSCode.Но когда я сохраняю его в github, набираю git add ..Это не сработало несколько раз.ИДК, если я пропустил шаг или что, но это всегда показывало предупреждение.Также git add, который я добавил до того, исчез в списке добавленных.Пожалуйста, помогите, я не могу продолжить урок.Спасибо.

xxx-MacBook-Air:~ userxxx$ git add --ignore-errors --force .
warning: could not open directory 'Library/Application Support/MobileSync/': Operation not permitted
warning: could not open directory 'Library/Application Support/CallHistoryTransactions/': Operation not permitted
warning: could not open directory 'Library/Application Support/com.apple.TCC/': Operation not permitted
warning: could not open directory 'Library/Application Support/CallHistoryDB/': Operation not permitted
warning: could not open directory 'Library/Saved Application State/com.vsco.vscokeys1.savedState/': Permission denied
warning: could not open directory 'Library/Saved Application State/com.adobe.flashplayer.installmanager.savedState/': Permission denied
warning: could not open directory 'Library/Saved Application State/com.bitrock.appinstaller.savedState/': Permission denied
warning: could not open directory 'Library/IdentityServices/': Operation not permitted
warning: could not open directory 'Library/Messages/': Operation not permitted
warning: could not open directory 'Library/HomeKit/': Operation not permitted
warning: could not open directory 'Library/Mail/': Operation not permitted
warning: could not open directory 'Library/Safari/': Operation not permitted
warning: could not open directory 'Library/Suggestions/': Operation not permitted
warning: could not open directory 'Library/Containers/com.apple.VoiceMemos/': Operation not permitted
warning: could not open directory 'Library/Containers/com.apple.Home/': Operation not permitted
warning: could not open directory 'Library/Containers/com.apple.Safari/': Operation not permitted
warning: could not open directory 'Library/Containers/com.apple.iChat/': Operation not permitted
warning: could not open directory 'Library/Containers/com.apple.mail/': Operation not permitted
warning: could not open directory 'Library/Containers/com.apple.stocks/': Operation not permitted
warning: could not open directory 'Library/PersonalizationPortrait/': Operation not permitted
warning: could not open directory 'Library/Metadata/CoreSpotlight/': Operation not permitted
warning: could not open directory 'Library/Metadata/com.apple.IntelligentSuggestions/': Operation not permitted
warning: could not open directory 'Library/Cookies/': Operation not permitted
warning: could not open directory 'Library/Caches/com.apple.safaridavclient/': Operation not permitted
warning: could not open directory 'Library/Caches/com.apple.HomeKit.configurations/': Operation not permitted
warning: could not open directory 'Library/Caches/CloudKit/com.apple.Safari/': Operation not permitted
warning: could not open directory 'Library/Caches/com.apple.Safari/': Operation not permitted
warning: could not open directory 'Library/Caches/com.apple.Safari.SafeBrowsing/': Operation not permitted

Я могу добавить изменения в мой github.

1 Ответ

0 голосов
/ 27 января 2019

Ошибка говорит о том, что у git нет разрешения на чтение из некоторых путей, к которым он не должен иметь доступ, потому что они являются защищенными частями ОС, к которым имеет доступ только администратор.

Вы выполняетекоманда git в домашнем каталоге вашего пользователя.Чтобы команда git add работала, вы должны выполнить ее в каталоге репозитория git.Если ваш репозиторий на самом деле является вашим домашним каталогом, это не очень хорошая идея, и вы должны немедленно изменить его.У вас должно быть одно хранилище на проект. Git сохранит все файлы и изменения файлов в этом и всех подкаталогах в хранилище, что не хорошо, если хранилище является вашим домашним каталогом.

...