Repository navigation
Onboarding GitHub Enterprise users #1180
Description
Activity
- addedneeds-designAn engineering task needs design to proceedAn engineering task needs design to proceedenhancementa request to improve CLIa request to improve CLI
on Jun 12, 2020 After chats with @ampinsk:
-
We will add a dedicated authentication command, so when we encounter a hostname we don't recognize, we can print something like:
To authenticate against example.com GitHub Enterprise instance, run `gh auth example.com`Dedicated authentication command #1413 -
Proposed syntaxes for explicitly selecting a hostname:
gh repo view hubot/robots --host example.comgh repo view example.com/hubot/robotsGH_HOST=example.com gh repo view hubot/robotsgh issue list -R example.com/hubot/robots
-
When someone has authenticated against multiple GitHub hosts, but hasn't explicitly specified one for a command such as
gh repo clone, there will be a prompt asking you to select a host.- Perhaps there could be a config setting to specify a default host?
Reacted by Gibson Fahnestock-
A nice default for some commands might be to look at the remote-tracking branches of
HEAD, e.g.gh repo fork-> default to forking the@{upstream}branch's remotegh pr create-> default to creating a PR to merge@{push}into@{upstream}(or merge@{upstream}into<prompt for remote>if@{push}==@{upstream})gh pr checkout-> default to checking@{upstream}remote for PRs
I currently use
hubto have a zero-manual-effortg prcommand, but it doesn't work when you have more than 2 remotes because, and it would be really nice to have this work in that context.
This works, but I find the interactive prompt sometimes tiresome considering I'm cloning from github.com 99% of the time.
FWIW 90% of the time I'm interacting with GHE (although it's really irritating because I already set up my remotes, so things should work with that).
Reacted by Mislav MarohnićAfter chats with @ampinsk, this is how a selection of a default host could look like:
$ gh config set default_host example.com $ gh repo clone owner/repo #=> defaults to cloning the repo from example.com $ gh repo clone github.com/owner/repo #=> explicitly clone a repo from github.com
Allowing the
--repooption to directly take a URL instead of just a org/repo combo would make things a lot easier, especially in situations when copy-pasting, or passing in input from scripts. Raised #1505
As part of offering GHE compatibility #273, we need to make some UI decisions on how to onboard users, i.e. authenticate them against their instance and detect when a local repository is a clone from a GHE host as opposed to from
github.com.When in the context of a git repository, we might detect that the main git remote does not point to a
github.comhost, but toexample.org, for example.example.orgis a GHE host that we should try authenticating against?Press Enter to open https://example.org/authorize in your browsergithub.comand others to a GHE host, which one should we default to?When not in the context of a git repository, how should users instruct commands such as
repo create,repo clone owner/repo,repo fork owner/repo, and commands such asissue view 123 -R owner/repoto operate on their GHE instance instead ofgithub.com?GITHUB_HOST=example.orgin their environment before invoking ahubcommand, and that solution is fine for programmatic use, but not ideal for casual use.hub clone repoprompt withSelect host:andgithub.com,example.orgas options. This works, but I find the interactive prompt sometimes tiresome considering I'm cloning fromgithub.com99% of the time./cc @ampinsk @billygriffin