Git push: “fatal 'origin' does not appear to be a git repository - fatal Could not read from remote repository.”

后端 未结 9 1282
再見小時候
再見小時候 2020-11-28 18:04

I know similar questions have already been asked.

But, I believe my issue is due to a mistake I have previously made and therefore is different: let me explain.

9条回答
  •  一向
    一向 (楼主)
    2020-11-28 18:25

    I had the same issue. When I checked my config file I noticed that 'fetch = +refs/heads/:refs/remotes/origin/' was on the same line as 'url = Z:/GIT/REPOS/SEL.git' as shown:

    [core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
    [remote "origin"]
        url = Z:/GIT/REPOS/SEL.git     fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master
    [gui]
        wmstate = normal
        geometry = 1109x563+32+32 216 255
    

    At first I did not think that this would have mattered but after seeing the post by Magere I moved the line and that fixed the problem:

    [core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
    [remote "origin"]
        url = Z:/GIT/REPOS/SEL.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master
    [gui]
        wmstate = normal
        geometry = 1109x563+32+32 216 255
    

提交回复
热议问题