Composer could not fetch github

Today, I try to do Laravel install by running composer create-project laravel/laravel=5.1.* myproject --prefer-dist and I get this error:

Could not fetch https://api.github.com/repos/laravel/laravel/zipball/716e65268ae123e5bd73e505acf9695c678aff88, please create a GitHub OAuth token to go over the API rate limit
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+MyPC+2016-02-19+0343 to retrieve a token. It will be stored in "C:/Users/MyPC/AppData/Roaming/Composer/auth.json" for future use by Composer.

Why am I unable to fetch from GitHub? This is the first time I am facing this after years of using. Is there any policy change by GitHub?


This policy has been active at Github a long time regrettably. It is documented here and you can see your current status at https://api.github.com/rate_limit in the core section.

Also see https://developer.github.com/v3/#rate-limiting:

For unauthenticated requests, the rate limit allows you to make up to 60 requests per hour. Unauthenticated requests are associated with your IP address, and not the user making requests.

There is nothing Composer can do to circumvent that, hence why it throws the verbose error:

Create a GitHub OAuth token to go over the API rate limit

You can do this at https://github.com/settings/tokens, and it needs to be done only once per installation as Composer remembers the token for subsequent requests.


The accepted answer of Niels is correct. To use the generated token in composer use the command:

composer config -g github-oauth.github.com YOUR_TOKEN