fatal: 'origin' does not appear to be a git repository

后端 未结 6 1055
情深已故
情深已故 2020-12-22 18:26

I\'ve a repository moodle on my Github account which I forked from the official repository.

I then cloned it on my local machine. It worked

6条回答
  •  暖寄归人
    2020-12-22 18:58

    I had the same error on git pull origin branchname when setting the remote origin as path fs and not ssh in .git/config:

    fatal: '/path/to/repo.git' does not appear to be a git repository 
    fatal: The remote end hung up unexpectedly
    

    It was like so (this only works for users on same server of git that have access to git):

    url = file:///path/to/repo.git/
    

    Fixed it like so (this works on all users that have access to git user (ssh authorizes_keys or password)):

    url = git@domain.com:path/to/repo.git
    

    the reason I had it as a directory path was because the git files are on the same server.

提交回复
热议问题