git Git远程命令返回致命:无效的refspec +refs/heads/*:refs/remotes/:origin/*

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32064360/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:16:47  来源:igfitidea点击:

Git remote command returns fatal: Invalid refspec +refs/heads/*:refs/remotes/:origin/*

gitgithub

提问by Ricardo Fornes

I accidentally modified my git config file and now hitting git remote --vin the terminal it returns: fatal: Invalid refspec '+refs/heads/*:refs/remotes/:origin/*',

我不小心修改了我的混帐配置文件,现在打git remote --v在终端它的回报:fatal: Invalid refspec '+refs/heads/*:refs/remotes/:origin/*'

What could be wrong in my config file, this is how it looks:

我的配置文件中可能有什么问题,它是这样的:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = ssh://[email protected]/myuserame/repo.git
    fetch = +refs/heads/*:refs/remotes/:origin/*

Any idea will be appreciated, Thanks.

任何想法将不胜感激,谢谢。

回答by VonC

You can fix it with a:

您可以使用以下命令修复它:

git config remote.origin.fetch refs/heads/*:refs/remotes/origin/*

(removing the :in :origin)

(删除:in :origin