-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth token stored on gitconfig file #1259
Comments
Hello, right now this isn't possible. However, if you don't wish to have the token stored in |
@mislav Did you think is could be useful put, optionally, token on gitconfig file? |
It's possible, but I don't want to use the gitconfig file for anything
related to hub.
|
Have you a specific reason for that? Tools like going store tokens on On Fri, Sep 9, 2016, 19:53 Mislav Marohnić notifications@github.com wrote:
Marcos H. Alano Sent from my Android |
Yes: to allow people to check their gitconfig in version control in case they back up their dotfiles. Lots of people publish their dotfiles on GitHub, and avoiding storing tokens in there reduces the risk of accidentally publishing your GitHub token. |
Interesting. I always saw as standard to put the token inside gitconfig. Lots of tools do that (the tools which support tokens, of course), so I think keep this option available (but not standard) should be good. |
If users have multiple accounts for work/non-work, what's the best way to have per-project tokens for hub? |
@lox If you have multiple GitHub accounts, there is no elegant way. You could create a wrapper script for hub: #!/bin/bash
set -e
# Check $PWD and set the token for this project accordingly:
export GITHUB_TOKEN="..."
exec hub "$@" Then you can |
The example shown above would work really well to leverage git 2.13's conditional includes: You could configure git to include additional config settings based on the path of the repo. Then the hub wrapper would merely need to invoke |
I would like to argue in favor of reading the token from the repo's It is the easiest way to configure different accounts per repo. You could slap a huge warning in the documenation to not do this and explain why. Anyone who does it anyway should be considered an adult who understands the consequences. I don't see a reason to publish Any chance you might reconsider? |
How can I do to store the OAuth token inside ~/.gitconfig instead ~/.config/hub? I want to do the "!" trick to get the token from my keychain.
The text was updated successfully, but these errors were encountered: