Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upgh repo create --repo org/repo creates owner/repo #702
Comments
You're welcome! It's not just me— we have a whole team!
I can see how this can be confusing. The global gh repo create ORG/REPONAMECan you try that and see if it works? And how could we improve the docs so the usage syntax of |
|
Hey @mislav and team! Thank you for making this cli! So I've tried your command, it indeed creates org/repo. I'm not sure if this is a bug, but if I added --repo flag it creates owner/repo. Because if I --help this command: It shows an option to use the global flag, if it's not applicable should we show it in help? |
For example: gh pr list #=> queries PRs in the current repository
gh pr list --repo cli/cli #=> queries PRs in the cli/cli repository
Exactly: we shouldn't show the flag here. The |
|
okay understood @mislav feel free to close this issue, or just reference it to hide the Stay healthy! |
|
Is there similarly a way to fork a repo into an organization, instead of a user? |
|
I have the same/similar issue. My owner is computermusik and I have an organisation called Quintet-net. The command "gh repo create Quintet-net/Sirenen" creates computermusik/Sirenen not Quintet-net/Sirenen. What am I missing here? |
@xloem There is currently no way to fork into an organization.
@computermusik That is indeed strange; your |
|
Hi Mislav,
Is this the correct syntax? I'm asking because I get an error when entering this line: DEBUG=api: Command not found.
Thanks,
Georg
… On 13. Apr 2020, at 16:10, Mislav Marohnić ***@***.***> wrote:
Is there similarly a way to fork a repo into an organization
@xloem <https://github.com/xloem> There is currently no way to fork into an organization.
The command "gh repo create Quintet-net/Sirenen" creates computermusik/Sirenen not Quintet-net/Sirenen
@computermusik <https://github.com/computermusik> That is indeed strange; your gh repo create should have definitely created the repository under the Quintet-net org. You can enable verbose logging with DEBUG=api gh repo create ... to try and spot something that seems off. Please report this and whatever else you find in a separate issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#702 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEFCMZUULZASVFY5WGY7ZNDRMMMMNANCNFSM4LUHHOKA>.
|
Sorry, the |
|
Alright, it worked in bash.
I'm attaching the dialog. What's a little irritating is that it states on the bottom:
fatal: remote origin already exists.
exit status 128
I guess this doesn't have much of an impact though, right?
Thanks for your help!
Georg
bash-3.2$ DEBUG=api gh repo create Quintet-net/Sirenen7 --public
[git rev-parse --show-toplevel]
* Request at 2020-04-13 21:38:14.049176 +0200 CEST m=+0.026273021
* Request to https://api.github.com/users/Quintet-net
GET /users/Quintet-net HTTP/1.1
Host: api.github.com
Accept: application/vnd.github.antiope-preview+json
Authorization: token ████████████████████
Content-Type: application/json; charset=utf-8
User-Agent: GitHub CLI 0.6.4
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
< Cache-Control: private, max-age=60, s-maxage=60
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json; charset=utf-8
< Date: Mon, 13 Apr 2020 19:38:14 GMT
< Etag: W/"b8c7c6615dffb25ec5b5b85fb381711c"
< Last-Modified: Sun, 12 Apr 2020 21:21:27 GMT
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: GitHub.com
< Status: 200 OK
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: Accept, Authorization, Cookie, X-GitHub-OTP
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Accepted-Oauth-Scopes:
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Media-Type: github.antiope-preview; format=json
< X-Github-Request-Id: E2EB:E7B6:63643D8:74A4B6C:5E94BFA6
< X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
< X-Oauth-Scopes: repo
< X-Ratelimit-Limit: 5000
< X-Ratelimit-Remaining: 4998
< X-Ratelimit-Reset: 1586810147
< X-Xss-Protection: 1; mode=block
{
"login": "Quintet-net",
"id": 63370256,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjYzMzcwMjU2",
"avatar_url": "https://avatars1.githubusercontent.com/u/63370256?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Quintet-net",
"html_url": "https://github.com/Quintet-net",
"followers_url": "https://api.github.com/users/Quintet-net/followers",
"following_url": "https://api.github.com/users/Quintet-net/following{/other_user}",
"gists_url": "https://api.github.com/users/Quintet-net/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Quintet-net/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Quintet-net/subscriptions",
"organizations_url": "https://api.github.com/users/Quintet-net/orgs",
"repos_url": "https://api.github.com/users/Quintet-net/repos",
"events_url": "https://api.github.com/users/Quintet-net/events{/privacy}",
"received_events_url": "https://api.github.com/users/Quintet-net/received_events",
"type": "Organization",
"site_admin": false,
"name": "Quintet.net",
"company": null,
"blog": "",
"location": null,
"email": null,
"hireable": null,
"bio": null,
"public_repos": 1,
"public_gists": 0,
"followers": 0,
"following": 0,
"created_at": "2020-04-08T19:21:39Z",
"updated_at": "2020-04-12T21:21:27Z"
}
* Request took 345.208544ms
* Request at 2020-04-13 21:38:14.394542 +0200 CEST m=+0.371627965
* Request to https://api.github.com/graphql
POST /graphql HTTP/1.1
Host: api.github.com
Accept: application/vnd.github.antiope-preview+json
Authorization: token ████████████████████
Content-Type: application/json; charset=utf-8
User-Agent: GitHub CLI 0.6.4
{
"query": "\n\tmutation($input: CreateRepositoryInput!) {\n\t\tcreateRepository(input: $input) {\n\t\t\trepository {\n\t\t\t\tid\n\t\t\t\tname\n\t\t\t\towner { login }\n\t\t\t\turl\n\t\t\t}\n\t\t}\n\t}\n\t",
"variables": {
"input": {
"name": "Sirenen7",
"visibility": "PUBLIC",
"ownerId": "MDEyOk9yZ2FuaXphdGlvbjYzMzcwMjU2",
"hasIssuesEnabled": true,
"hasWikiEnabled": true
}
}
}
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
< Cache-Control: no-cache
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json; charset=utf-8
< Date: Mon, 13 Apr 2020 19:38:15 GMT
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: GitHub.com
< Status: 200 OK
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Accepted-Oauth-Scopes: repo
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Media-Type: github.antiope-preview; format=json
< X-Github-Request-Id: E2EB:E7B6:6364414:74A4BB0:5E94BFA6
< X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
< X-Oauth-Scopes: repo
< X-Ratelimit-Limit: 5000
< X-Ratelimit-Remaining: 4998
< X-Ratelimit-Reset: 1586810147
< X-Xss-Protection: 1; mode=block
{
"data": {
"createRepository": {
"repository": {
"id": "MDEwOlJlcG9zaXRvcnkyNTU0MjQ2Nzg=",
"name": "Sirenen7",
"owner": {
"login": "Quintet-net"
},
"url": "https://github.com/Quintet-net/Sirenen7"
}
}
}
}
* Request took 1.236872568s
✓ Created repository Quintet-net/Sirenen7 on GitHub
[git remote add origin https://github.com/Quintet-net/Sirenen7.git]
fatal: remote origin already exists.
exit status 128
… On 13. Apr 2020, at 19:26, Mislav Marohnić ***@***.***> wrote:
I'm asking because I get an error when entering this line: DEBUG=api: Command not found.
Sorry, the DEBUG=api gh ... syntax only works in shells such as bash, zsh, fish. If you are in a different shell, such as PowerShell on Windows, the syntax to set an export an environment variable might be different. Please consult the documentation for your shell!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#702 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEFCMZRUYZ6PPW22AGMYLSTRMNDN3ANCNFSM4LUHHOKA>.
|
Thanks for trying! Are you saying that
What I think happened is that you ran What do you think would be better behavior? |
|
Hi,
All is good now. I suspect that I made a mistake when I (first) tried the create a ripo.
Thanks for your help.
… On 14. Apr 2020, at 10:15, Mislav Marohnić ***@***.***> wrote:
Alright, it worked in bash.
Thanks for trying! Are you saying that gh repo create Quintet-net/Sirenen did the right thing in bash (creating an org repo), but produced the wrong result (created a personal repo) in a different shell? If so, then this smells like a bug and we would appreciate knowing about the specifics so we can track it down and fix it for your shell.
What's a little irritating is that it states on the bottom:
fatal: remote origin already exists.
exit status 128
What I think happened is that you ran gh repo create from the current directory where there is already a git repository, and in that case gh repo create assumes that you are creating a GitHub repository where you intend to push the code from your local git repository and tries to add it as "origin" remote, but you already have that remote.
What do you think would be better behavior?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#702 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEFCMZRF47ZLHEWZY4LQNFTRMQLSJANCNFSM4LUHHOKA>.
|
Describe the bug
Hi @mislav! Thank you for creating this. I'm trying to create the new repo via CLI, and it seems --repo is not passing the owner/repo format? It just defaults to owner/folder-name
In fact, I try to create a new repo using a different name it says repository already exists.
gh version 0.6.2 (2020-03-18)
Steps to reproduce the behavior
reponameExpected vs actual behavior
It should create a repo name under the org.
Logs
Doing it twice says:
graphql error: 'Name already exists on this account'
Even though there's no repo name under the org, only the local repo under my own account.