Hub: oauth with ~/.config/hub not working

Created on 29 May 2017  路  8Comments  路  Source: github/hub

I created an oauth token (github web settings) - however hub pull-request still asks for my credentials.
is it related to the fact that my remote origin configured with ssh (not https)?

more-info-needed

Most helpful comment

@adibPlaybuzz Make sure that you're on the latest version of hub, and that your ~/.config/hub looks like this:

github.com:
- user: mislav
  oauth_token: PASTE_YOUR_TOKEN_HERE
  protocol: https

You should not be asked for authentication past that point.

Also note that hub authentication is completely separate from git authentication (which can be done either over SSH or HTTPS). Even though authentication for git cloning/pushing is already set up on your machine, you still need to complete hub authentication additionally.

All 8 comments

Had the same problem. Changing remote to git protocol solved it.

@glukki:

It seems to fix it sometimes, but not always.

@adibPlaybuzz Make sure that you're on the latest version of hub, and that your ~/.config/hub looks like this:

github.com:
- user: mislav
  oauth_token: PASTE_YOUR_TOKEN_HERE
  protocol: https

You should not be asked for authentication past that point.

Also note that hub authentication is completely separate from git authentication (which can be done either over SSH or HTTPS). Even though authentication for git cloning/pushing is already set up on your machine, you still need to complete hub authentication additionally.

@mislav I'm using hub version 2.2.9 (from home-brew), and my ~/.config/hub looks like that.

complete hub authentication additionally.

What is "hub authentication". Are you referring to authenticating with GitHub for issues and such and with Git for push/pull etc?

@spott Then hub authentication should be all configured for you and ready to go.

Are you connecting to GitHub Enterprise instance by any chance? What are the exact errors that you're getting?

This helped me resolve my issue with the config file. Suggest we close this as the bug appears to be user error.

@adibPlaybuzz Make sure that you're on the latest version of hub, and that your ~/.config/hub looks like this:

github.com:
- user: mislav
  oauth_token: PASTE_YOUR_TOKEN_HERE
  protocol: https

You should not be asked for authentication past that point.

Also note that hub authentication is completely separate from git authentication (which can be done either over SSH or HTTPS). Even though authentication for git cloning/pushing is already set up on your machine, you still need to complete hub authentication additionally.

Thanks.
When I follow this ~/.config/hub

 github.com:
 - user: mislav
   oauth_token: PASTE_YOUR_TOKEN_HERE
   protocol: https

It works. Please do not miss the -.
PS: I use the GitHub enterprise(github.org.com)

I did not find an example of ~/.config/hub at docs and was forced to googling about how to properly use oauth token with hub. Maybe add some info about it to the docs?

Was this page helpful?
0 / 5 - 0 ratings