diff --git a/README.md b/README.md index a4d230d01..56c5fc3d6 100644 --- a/README.md +++ b/README.md @@ -302,24 +302,10 @@ superpowers: Configuration ------------- -### GitHub username & token +### GitHub OAuth authentication -To get the most out of hub, you'll want to ensure your GitHub login -is stored locally in your Git config or environment variables. - -To test it run this: - - $ git config --global github.user - -If you see nothing, you need to set the config setting: - - $ git config --global github.user YOUR_USER - -For commands that require write access to GitHub (such as `fork`), you'll want to -setup "github.token" as well. See [GitHub config guide][2] for more information. - -If present, environment variables `GITHUB_USER` and `GITHUB_TOKEN` override the -values of "github.user" and "github.token". +Hub will prompt for GitHub username & password the first time it needs to access +the API and exchange it for an OAuth token, which it saves in "~/.config/hub". ### HTTPS insted of git protocol @@ -381,5 +367,4 @@ GitHub simpler: [speed]: http://gist.github.com/284823 -[2]: http://help.github.com/set-your-user-name-email-and-github-token/ [gc]: https://twitter.com/brynary/status/49560668994674688 diff --git a/man/hub.1 b/man/hub.1 index dc37e249d..e7951f401 100644 --- a/man/hub.1 +++ b/man/hub.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "HUB" "1" "March 2012" "DEFUNKT" "Git Manual" +.TH "HUB" "1" "April 2012" "DEFUNKT" "Git Manual" . .SH "NAME" \fBhub\fR \- git + hub = github @@ -132,7 +132,7 @@ Open a GitHub compare view page in the system\'s default web browser\. \fISTART\ . .TP \fBgit fork\fR [\fB\-\-no\-remote\fR] -Forks the original project (referenced by "origin" remote) on GitHub and adds a new remote for it under your username\. Requires \fBgithub\.token\fR to be set (see CONFIGURATION)\. +Forks the original project (referenced by "origin" remote) on GitHub and adds a new remote for it under your username\. . .TP \fBgit pull\-request\fR [\fB\-f\fR] [\fITITLE\fR|\fB\-i\fR \fIISSUE\fR|\fIISSUE\-URL\fR] [\fB\-b\fR \fIBASE\fR] [\fB\-h\fR \fIHEAD\fR] @@ -145,37 +145,7 @@ If \fITITLE\fR is omitted, a text editor will open in which title and body of th If instead of normal \fITITLE\fR an issue number is given with \fB\-i\fR, the pull request will be attached to an existing GitHub issue\. Alternatively, instead of title you can paste a full URL to an issue on GitHub\. . .SH "CONFIGURATION" -Use git\-config(1) to display the currently configured GitHub username: -. -.IP "" 4 -. -.nf - -$ git config \-\-global github\.user -. -.fi -. -.IP "" 0 -. -.P -Or, set the GitHub username and token with: -. -.IP "" 4 -. -.nf - -$ git config \-\-global github\.user -$ git config \-\-global github\.token -. -.fi -. -.IP "" 0 -. -.P -You can override these values with \fIGITHUB_USER\fR and \fIGITHUB_TOKEN\fR environment variables\. -. -.P -See \fIhttp://help\.github\.com/set\-your\-user\-name\-email\-and\-github\-token/\fR for more information\. +Hub will prompt for GitHub username & password the first time it needs to access the API and exchange it for an OAuth token, which it saves in "~/\.config/hub"\. . .P If you prefer the HTTPS protocol for GitHub repositories, you can set "hub\.protocol" to "https"\. This will affect \fBclone\fR, \fBfork\fR, \fBremote add\fR and other operations that expand references to GitHub repositories as full URLs that otherwise use git and ssh protocols\. @@ -204,20 +174,6 @@ $ git config \-\-global \-\-add hub\.host my\.git\.org .IP "" 0 . .P -API username and token need also be configured for each Enterprise host: -. -.IP "" 4 -. -.nf - -$ git config \-\-global github\."my\.git\.org"\.user -$ git config \-\-global github\."my\.git\.org"\.token -. -.fi -. -.IP "" 0 -. -.P The default host for commands like \fBinit\fR and \fBclone\fR is still github\.com, but this can be affected with the \fIGITHUB_HOST\fR environment variable: . .IP "" 4 diff --git a/man/hub.1.html b/man/hub.1.html index c5ecf592a..b42306562 100644 --- a/man/hub.1.html +++ b/man/hub.1.html @@ -173,8 +173,7 @@

DESCRIPTION

it will be transformed into one with three dots. If START is omitted, GitHub will compare against the base branch (the default is "master").

git fork [--no-remote]

Forks the original project (referenced by "origin" remote) on GitHub and -adds a new remote for it under your username. Requires github.token to -be set (see CONFIGURATION).

+adds a new remote for it under your username.

git pull-request [-f] [TITLE|-i ISSUE|ISSUE-URL] [-b BASE] [-h HEAD]

Opens a pull request on GitHub for the project that the "origin" remote points to. The default head of the pull request is the current branch. Both base and head of the pull request can be explicitly given in one of @@ -194,22 +193,8 @@

DESCRIPTION

CONFIGURATION

-

Use git-config(1) to display the currently configured GitHub username:

- -
$ git config --global github.user
-
- -

Or, set the GitHub username and token with:

- -
$ git config --global github.user <username>
-$ git config --global github.token <token>
-
- -

You can override these values with GITHUB_USER and GITHUB_TOKEN -environment variables.

- -

See http://help.github.com/set-your-user-name-email-and-github-token/ for more -information.

+

Hub will prompt for GitHub username & password the first time it needs to access +the API and exchange it for an OAuth token, which it saves in "~/.config/hub".

If you prefer the HTTPS protocol for GitHub repositories, you can set "hub.protocol" to "https". This will affect clone, fork, remote add @@ -228,12 +213,6 @@

GitHub Enterprise

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

API username and token need also be configured for each Enterprise host:

- -
$ git config --global github."my.git.org".user <username>
-$ git config --global github."my.git.org".token <token>
-
-

The default host for commands like init and clone is still github.com, but this can be affected with the GITHUB_HOST environment variable:

@@ -448,7 +427,7 @@

SEE ALSO

  1. DEFUNKT
  2. -
  3. March 2012
  4. +
  5. April 2012
  6. hub(1)
diff --git a/man/hub.1.ronn b/man/hub.1.ronn index e002c8616..325367fc0 100644 --- a/man/hub.1.ronn +++ b/man/hub.1.ronn @@ -128,8 +128,7 @@ hub also adds some custom commands that are otherwise not present in git: * `git fork` [`--no-remote`]: Forks the original project (referenced by "origin" remote) on GitHub and - adds a new remote for it under your username. Requires `github.token` to - be set (see CONFIGURATION). + adds a new remote for it under your username. * `git pull-request` [`-f`] [|`-i` <ISSUE>|<ISSUE-URL>] [`-b` <BASE>] [`-h` <HEAD>]: Opens a pull request on GitHub for the project that the "origin" remote @@ -149,20 +148,8 @@ hub also adds some custom commands that are otherwise not present in git: ## CONFIGURATION -Use git-config(1) to display the currently configured GitHub username: - - $ git config --global github.user - -Or, set the GitHub username and token with: - - $ git config --global github.user <username> - $ git config --global github.token <token> - -You can override these values with <GITHUB_USER> and <GITHUB_TOKEN> -environment variables. - -See <http://help.github.com/set-your-user-name-email-and-github-token/> for more -information. +Hub will prompt for GitHub username & password the first time it needs to access +the API and exchange it for an OAuth token, which it saves in "~/.config/hub". If you prefer the HTTPS protocol for GitHub repositories, you can set "hub.protocol" to "https". This will affect `clone`, `fork`, `remote add` @@ -179,11 +166,6 @@ configure hub to treat such remotes same as github.com: $ git config --global --add hub.host my.git.org -API username and token need also be configured for each Enterprise host: - - $ git config --global github."my.git.org".user <username> - $ git config --global github."my.git.org".token <token> - The default host for commands like `init` and `clone` is still github.com, but this can be affected with the <GITHUB_HOST> environment variable: