我最近在 OS X 10.11.5 上安装并使用了 MacVim,我想安装一些插件。我成功安装了 Vundle,但是当我尝试使用 Vundle 安装插件时遇到错误。我尝试安装的插件是 YouCompleteMe 。我所做的是输入 :PluginInstall YouCompleteMe
,但是,当我执行此操作时,出现以下错误:
"fatal: could not read Username for 'https://github.com': Device not configured"
这很奇怪;我有一个 GitHub 帐户,但我没有因此获得晋升。我对 git 很陌生,因此我们将不胜感激!
这是 error log. 的屏幕截图
更新:
我从命令提示符运行了克隆,它有效,但我希望能够从 MacVim 内部管理它。此外,MacVim 使用的 URL 是错误的。我必须转到页面本身并获取不同的 URL。如果可能的话,我想在 MacVim 中自动执行此操作。即使使用 SSH 而不是 HTTPS 也无法解决 URL 错误的问题。
最佳答案
使用 ssh 而不是 https:
git config --global url."<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0c6b65784c6b657864796e226f6361" rel="noreferrer noopener nofollow">[email protected]</a>:".insteadOf https://github.com/
然后再次尝试插件安装:any https://github.com现在应该使用 ssh url 进行访问。
同样:
git config --global url."https://github.com/vim-scripts/YouCompleteMe.git".insteadOf "https://github.com/Valloric/YouCompleteMe.git"
这将“在 MacVim 内自动执行此操作”。
如果您的本地存储库的网址错误:
cd /path/to/local/repo
git remote set-url origin https://github.com/Valloric/YouCompleteMe.git
关于使用 Vundle 安装时出现 Git 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38938107/