问题
I'm trying to create a pull request for the nuget git repository (which I just did a clone from). I've made a local commit.
But when I try to create the pull request I get the following error:
Could not find any relevant repository hosts for the currently open repository
What does that mean, and how do I fix it? Do I have to fork instead of cloning? If so, what should I do now that I've made changes to the clone?
回答1:
A pull request, especially on GitHub, supposed that you have forked a GitHub repo first, and then clone that fork.
That means, of course, that you could not directly pushed back to the repo you have cloned in the first place, because you are not a collaborator for that repo (or you don't own that repo).
But if you want to do a pull request, it is assumed that you cannot contribute directly to the upstream repo. If you could, no pull request would be necessary.
It turns out the OP jgauffin is working with CodePlex, but the mechanism is the same for CodePlex forks.
If you have a clone, you can make it reference the fork by:
- renaming origin to upstream:
git remote rename origin upstream
- adding origin with a
git remote add origin url/to/your/fork
See "What is the difference between origin and upstream in github"
来源:https://stackoverflow.com/questions/15632029/could-not-find-any-relevant-repository-hosts-for-the-currently-open-repository