1

I have a repository myrepo but when I try to fetch it, I cannot. This repository exists on Github as well. Fetching origin/myrepo causes an error as well.

Here is the error:

$ 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

Clearly, as per the last command, the directory exists.

Eric Baldwin
  • 3,143
  • 9
  • 30
  • 64

2 Answers2

1

The easiest way is to fetch everything:

git fetch origin

But if you want to fetch only one branch:

git fetch <remotename> <remote branch>:refs/remotes/<remotename>/<local branch>

That is, in your case:

git fetch origin myrepo:refs/remotes/origin/myrepo
Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
0

myrepo is just a local branch in your local repository.

Use git remote -v to check what's the remote's name you have.

xdazz
  • 154,648
  • 35
  • 237
  • 264