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

Ric*_*nes 8 git github

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

我的配置文件可能有什么问题,它的外观如下:

[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/*
Run Code Online (Sandbox Code Playgroud)

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

Von*_*onC 14

您可以使用以下方法修复它:

git config remote.origin.fetch refs/heads/*:refs/remotes/origin/*
Run Code Online (Sandbox Code Playgroud)

(删除:in :origin)