使用Vundle进行安装时出现Git错误

时间:2016-08-14 00:22:22

标签: git vim macvim

我最近安装并在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问题。

1 个答案:

答案 0 :(得分:0)

使用ssh而不是https:

git config --global url."git@github.com:".insteadOf https://github.com/

然后再次尝试插件安装:任何https://github.com访问权限现在应该使用ssh网址。

类似地:

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