Get github credentials from environment if they are not found in git config #51

wants to merge 3 commits into


None yet
1 participant

ilkka commented Apr 29, 2011


Here's a little something that allows github to use GITHUB_USER and GITHUB_TOKEN environment variables as alternatives to the git config keys github.user and github.token. I wrote this up when I realized I might in some cases want to version control my ~/.gitconfig. Hope you find it useful.

ilkka added some commits Apr 29, 2011

@ilkka ilkka Specs for getting github credentials from environment
Expects GitHub::Command to use a getenv helper to query the environment.
@ilkka ilkka Get github credentials from environment if not in config
Queries the environment for GITHUB_USER and GITHUB_TOKEN using a getenv helper.
The values from git config are preferred, but if they don't exist, the
environment versions are used.
@ilkka ilkka Fix other github_user related specs to expect getenv calls 8a5a8f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment