简体   繁体   English

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

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

I accidentally modified my git config file and now hitting git remote --v in the terminal it returns: fatal: Invalid refspec '+refs/heads/*:refs/remotes/:origin/*' , 我不小心修改了我的git配置文件,现在点击它返回的终端中的git remote --vfatal: 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://git@github.com/myuserame/repo.git
    fetch = +refs/heads/*:refs/remotes/:origin/*

Any idea will be appreciated, Thanks. 任何想法将不胜感激,谢谢。

You can fix it with a: 您可以使用以下方法修复它:

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

(removing the : in :origin ) (删除: in :origin

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 致命:refspec的远程部分不是.git / refs / heads / master中的有效名称:.git / refs / remotes / origin / master - fatal: remote part of refspec is not a valid name in .git/refs/heads/master:.git/refs/remotes/origin/master 致命的:无效的refspec'+ refs / heads / *' - fatal: Invalid refspec '+refs/heads/*' Git 中的“refs/heads/master”是否与“refs/remotes/origin/master”相同? - Is "refs/heads/master" same as "refs/remotes/origin/master" in Git? Git push Refspecs:`refs / heads / *:refs / heads / origin`与`refs / heads / *:refs / heads / *` - Git push Refspecs: `refs/heads/*:refs/heads/origin` vs `refs/heads/*:refs/heads/*` 为什么git fetch origin + refs / heads / master:refs / remotes / origin / mymaster和git fetch origin master:mymaster的行为不同? - Why behaviour of git fetch origin +refs/heads/master:refs/remotes/origin/mymaster and git fetch origin master:mymaster is different? 遥控器的“ git fetch”遥控器 - “git fetch” remote refs of remotes 在使用 @io_bazel_rules_docker 时运行 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' 时出错 - error running 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' while working with @io_bazel_rules_docker Git致命:引用的格式无效:'refs / heads / master - Git fatal: Reference has invalid format: 'refs/heads/master ls-remote --heads origin vs ls-remote。 “裁判/遥控器/ *” - ls-remote --heads origin vs ls-remote . “refs/remotes/*” 什么是`git push origin master`?帮助git的refs,head和remotes - What is `git push origin master`? Help with git's refs, heads and remotes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM