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

20,707

You can fix it with a:

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

(removing the : in :origin)

Share:
20,707
Ricardo Fornes
Author by

Ricardo Fornes

Updated on August 09, 2021

Comments

  • Ricardo Fornes
    Ricardo Fornes over 2 years

    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/*',

    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.