Tim
Tim

Reputation: 99488

hub: Aborted: the origin remote doesn't point to a GitHub repository

I committed some changes to a file and pushed it to GitHub:

git add myfile
git commit -m "some change to myfile"
git push origin feature

Then I would like to create a pull request:

$ hub pull-request -b master -h feature
Aborted: the origin remote doesn't point to a GitHub repository.

Since origin in the git push origin feature works, why does it say it doesn't point to a GitHub repository?

Also can I specify the reviewer and assignee from terminal?

Thanks.


$ git remote show origin
* remote origin
  Fetch URL: https://git.xxx.net/xxx
  Push  URL: https://git.xxx.net/xxx
  HEAD branch: master
  Remote branches:
    ...   

Upvotes: 1

Views: 1935

Answers (4)

d.lime
d.lime

Reputation: 393

Running hub on GitHub Actions, in a different repo folder, also got me the error Aborted: the origin remote doesn't point to a GitHub repository

In my case I had to use hub pull-request --force to make it work, since setting the remote didn't solve the issue.

Upvotes: 0

Vincent Zhang
Vincent Zhang

Reputation: 389

This is mentioned in the hub man page

By default, hub will only work with repositories that have remotes which point to github.com. If you are using GitHub Enterprise, your host need to be whitelisted:

$ git config --global --add hub.host my.git.org

Upvotes: 6

avotoast
avotoast

Reputation: 51

Vincent Zhang has it right!

$ git config --global --add hub.host git.xxxx.org

(the --global is optional, of course)

Worked for me, it is in the man pages under GitHub Enterprise

https://hub.github.com/hub.1.html

Upvotes: 1

Joe Atzberger
Joe Atzberger

Reputation: 3306

hub is GitHub's command-line extensions available here. It shouldn't be necessary for anything that is a core git feature.

Pull Requests, however, are a GitHub feature, not a git feature. Your error message is entirely correct: "origin remote doesn't point to a GitHub repository" because https://git.xxx.net/xxx is not GitHub.

Options are:

  • use GitHub, or
  • don't use hub

Upvotes: 5

Related Questions