我正在编写一个 Makefile 来同步我的本地点文件与 GitHub。我最近决定将我的 .vim 文件夹添加到存储库中。但是当尝试复制 .vim 文件夹时,我不断收到“权限被拒绝”错误。
Makefile 中应复制该文件夹的行是:
@$(foreach file, $(FILES), echo "Copying $(BASH_DIR)$(file) to ."; cp -R $(BASH_DIR)$(file) . ; )
.vim 文件夹的权限是 drwxr-xr-x,我收到的错误消息是:
cp: ./.vim/bundle/editorconfig-vim/.git/objects/pack/pack-bbb66dd84e2bdd3b05e19454b0800a928ecb94db.idx: Permission denied
cp: ./.vim/bundle/editorconfig-vim/.git/objects/pack/pack-bbb66dd84e2bdd3b05e19454b0800a928ecb94db.pack: Permission denied
cp: ./.vim/bundle/snipmate.vim/.git/objects/4d/e66757eebe4798eaaf02e3762a152d283eca81: Permission denied
cp: ./.vim/bundle/snipmate.vim/.git/objects/58/165f0e58211f8a5910df65414cc637651f046a: Permission denied
cp: ./.vim/bundle/snipmate.vim/.git/objects/6e/e90f3cfbd7c4956892da49896f62614448f851: Permission denied
cp: ./.vim/bundle/snipmate.vim/.git/objects/fc/161ff6515d405831c65c608d63627aa60c4066: Permission denied
cp: ./.vim/bundle/snipmate.vim/.git/objects/pack/pack-182ea16d08e5b471d5ce5f545f599f24ebe306cf.idx: Permission denied
cp: ./.vim/bundle/snipmate.vim/.git/objects/pack/pack-182ea16d08e5b471d5ce5f545f599f24ebe306cf.pack: Permission denied
cp: ./.vim/bundle/vim-jade/.git/objects/pack/pack-20254027167dcc621463c4454ed0fc539cf0b1da.idx: Permission denied
cp: ./.vim/bundle/vim-jade/.git/objects/pack/pack-20254027167dcc621463c4454ed0fc539cf0b1da.pack: Permission denied
cp: ./.vim/bundle/vim-markdown/.git/objects/pack/pack-b18aa89f38b322d622d05d969a9df41915bf9ea8.idx: Permission denied
cp: ./.vim/bundle/vim-markdown/.git/objects/pack/pack-b18aa89f38b322d622d05d969a9df41915bf9ea8.pack: Permission denied
有谁知道我怎样才能让它发挥作用?最好无需手动更改权限。
@vonbrand 我正在尝试将我的 vim 设置添加到我的点文件中,以便在其他终端上轻松访问。我在用病原处理我的 vim 插件。它们是通过将插件克隆到.vim/bundles
目录中来处理的。当我尝试cp -r
.vim
进入我的 dotfiles 文件夹时,出现上述错误。我想找到一些解决方案,将这些存储库作为我的 dotfiles 文件夹的一部分,而无需手动更改权限,因为这将迫使我每次决定添加或更改插件时都重复该过程。我不知道我正在寻找的解决方案是否是将某些选项传递给cp
,或使用其他一些工具来复制或同步.vim
目录,或者是否chown
是我唯一的选择。
ls -ld ~/.vim/bundle/vim-jade/.git
回报drwxr-xr-x 12 $USER staff 408 Jan 21 15:26 ~/.vim/bundle/vim-jade/.git