我有一个存储库myrepo
但是当我尝试获取它时,我不能。此存储库也存在于Github上。获取origin/myrepo
也会导致错误。
这是错误:
$ git fetch myrepo
fatal: 'myrepo' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
$ git fetch origin/myrepo
fatal: 'origin/myrepo' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
$ git branch
calendar
master
* myrepo
routes
显然,根据最后一个命令,目录存在。
答案 0 :(得分:0)
myrepo
只是本地存储库中的本地分支。
使用git remote -v
检查您的遥控器名称是什么。
答案 1 :(得分:0)
最简单的方法是获取所有内容:
git fetch origin
但是如果你想要fetch only one branch:
git fetch <remotename> <remote branch>:refs/remotes/<remotename>/<local branch>
就是说,在你的情况下:
git fetch origin myrepo:refs/remotes/origin/myrepo