“git init” failed, what's wrong?

前端 未结 6 1889
花落未央
花落未央 2021-02-07 10:26

This issue is not same as \"Bad git config file .git/config\", since it failed when using git init.

It seems there is nothing wrong with /home/mirror/.gitco

6条回答
  •  时光取名叫无心
    2021-02-07 11:01

    Since I came across this when searching for the Malformed value for push.default: simple error I got when pushing/pulling, I figured other people may as well.

    Here's a related question that provides more information for the passer-by (see my answer at the end for more links, too): GIT: Can't Push (Strange Config Issue)

    Note in particular that this error seems to be caused by having an older version of Git somewhere. The best solution is to update to the latest version of Git on all machines.

    If this is not possible for you, simply run the following commands (as mentioned by @morefromalan):

    git config --global push.default matching
    

    or

    git config --global push.default upstream
    

    to get rid of the error. This changes the default behavior of push operations as described HERE. You may have to to this for pull as well as push, but it seems to be working for me just having changed the default push behavior to upstream.

    Good luck!

提交回复
热议问题