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.

1
  • use "git branch -r" to see what remote branches actually exist for your project Commented Dec 26, 2013 at 6:54

2 Answers 2

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
Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.