简体   繁体   中英

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

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 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM