github-gem icon indicating copy to clipboard operation
github-gem copied to clipboard

create doesn't work without insane genius

Open kjvarga opened this issue 15 years ago • 5 comments

I've never been able to get the 'gh create' calls to work. I tried all sorts of combinations and trying to specify the repo in different ways. Nada. So I decided to write up an issue...then I decided I'd better just look at the source. And there is, some mysterious github token! I didn't have one. So I googled and discovered that I do have one and I need to set that in my global git config.

Could you please add a line saying that you need to do this step to the install?! Unless I'm missing something how would any normal person know to do this?

Cheers, Karl

PS A check that the token isn't empty would be good in the 'create' calls..or wherever it's needed. Perhaps that would even be enough. 'You haven't configured your GitHub API key! Please go to http://github.com/[github_user] and blah...'

kjvarga avatar Dec 10 '09 05:12 kjvarga

I added some code to help with this here

http://github.com/barryk/github-gem/commit/36063bf5ae8731eca1c0afd9e0c4a9ccb99705fa

Part of my PullRequest branch http://github.com/barryk/github-gem/tree/PullRequest

barryk avatar Jan 23 '10 21:01 barryk

First time you run "create" it asks for your user and token, and explains where to get the token... So I think this thread could be closed, isn't it?

igorsantos07 avatar Jul 28 '11 04:07 igorsantos07

I've hit this today, and it seems like support for the API token is being removed.

Is there an alternative right now?

mattwynne avatar May 15 '12 07:05 mattwynne

I gave create an API token with all possible access rights, but it gives me the error:

gh create new-repo
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

There are no more access rights, and of course the repository doesn't exist – I'm trying to create it.

lorensr avatar Jan 06 '15 22:01 lorensr

Also:

$ cd new-repo
$ git init .
$ gh create-from-local new-repo
 (JSON::ParserError)gems/2.1.0/gems/json_pure-1.5.5/lib/json/common.rb:148:in `parse': 757: unexpected token at '<html>
<head><title>410 Gone</title></head>
<body bgcolor="white">
<center><h1>410 Gone</h1></center>
<hr><center>nginx</center>
</body>
</html>'
    from /usr/local/lib/ruby/gems/2.1.0/gems/json_pure-1.5.5/lib/json/common.rb:148:in `parse'
    from /usr/local/lib/ruby/gems/2.1.0/gems/github-0.7.2/lib/commands/commands.rb:260:in `block in load'
    from /usr/local/lib/ruby/gems/2.1.0/gems/github-0.7.2/lib/github/command.rb:25:in `call'
    from /usr/local/lib/ruby/gems/2.1.0/gems/github-0.7.2/lib/github.rb:76:in `invoke'
    from /usr/local/lib/ruby/gems/2.1.0/gems/github-0.7.2/lib/github.rb:70:in `activate'
    from /usr/local/lib/ruby/gems/2.1.0/gems/github-0.7.2/bin/gh:8:in `<top (required)>'
    from /usr/local/bin/gh:23:in `load'
    from /usr/local/bin/gh:23:in `<main>'

lorensr avatar Jan 06 '15 22:01 lorensr