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

后端 未结 6 1064
情深已故
情深已故 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 19:07

    I faced the same problem when I renamed my repository on GitHub. I tried to push at which point I got the error

    fatal: 'origin' does not appear to be a git repository
    fatal: The remote end hung up unexpectedly
    

    I had to change the URL using

    git remote set-url origin ssh://git@github.com/username/newRepoName.git
    

    After this all commands started working fine. You can check the change by using

    git remote -v
    

    In my case after successfull change it showed correct renamed repo in URL

    [aniket@alok Android]$ git remote -v
    origin  ssh://git@github.com/aniket91/TicTacToe.git (fetch)
    origin  ssh://git@github.com/aniket91/TicTacToe.git (push)
    

提交回复
热议问题